mirror of
				https://github.com/cloudreve/cloudreve.git
				synced 2025-10-31 08:39:10 +08:00 
			
		
		
		
	Modify: use INT represent Database port
This commit is contained in:
		| @ -32,7 +32,7 @@ func Init() { | ||||
| 			// 未指定数据库时,使用SQLite | ||||
| 			db, err = gorm.Open("sqlite3", util.RelativePath(conf.DatabaseConfig.DBFile)) | ||||
| 		} else { | ||||
| 			db, err = gorm.Open(conf.DatabaseConfig.Type, fmt.Sprintf("%s:%s@(%s:%s)/%s?charset=utf8&parseTime=True&loc=Local", | ||||
| 			db, err = gorm.Open(conf.DatabaseConfig.Type, fmt.Sprintf("%s:%s@(%s:%d)/%s?charset=utf8&parseTime=True&loc=Local", | ||||
| 				conf.DatabaseConfig.User, | ||||
| 				conf.DatabaseConfig.Password, | ||||
| 				conf.DatabaseConfig.Host, | ||||
|  | ||||
| @ -15,7 +15,7 @@ type database struct { | ||||
| 	Name        string | ||||
| 	TablePrefix string | ||||
| 	DBFile      string | ||||
| 	Port		string | ||||
| 	Port        int | ||||
| } | ||||
|  | ||||
| // system 系统通用配置 | ||||
|  | ||||
| @ -13,6 +13,7 @@ var RedisConfig = &redis{ | ||||
| var DatabaseConfig = &database{ | ||||
| 	Type:   "UNSET", | ||||
| 	DBFile: "cloudreve.db", | ||||
| 	Port:   3306, | ||||
| } | ||||
|  | ||||
| // SystemConfig 系统公用配置 | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 HFO4
					HFO4