style: 配置文件读取错误显示中文问题
This commit is contained in:
@@ -18,7 +18,7 @@ func InitConfig(configFile string) {
|
|||||||
// 读取配置文件
|
// 读取配置文件
|
||||||
err := v.ReadInConfig()
|
err := v.ReadInConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("读取配置文件失败: %v \n", err)
|
fmt.Printf("failure to read configuration file: %v \n", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -149,9 +149,9 @@ gorm:
|
|||||||
type: "mysql"
|
type: "mysql"
|
||||||
host: "127.0.0.1"
|
host: "127.0.0.1"
|
||||||
port: 3306
|
port: 3306
|
||||||
username: "<用户名>"
|
username: "<username>"
|
||||||
password: "<密码>"
|
password: "<password>"
|
||||||
database: "<数据库>"
|
database: "<database>"
|
||||||
logging: false
|
logging: false
|
||||||
# 多个数据源时可以用这个指定默认的数据源
|
# 多个数据源时可以用这个指定默认的数据源
|
||||||
defaultDataSourceName: "default"
|
defaultDataSourceName: "default"
|
||||||
@@ -162,7 +162,7 @@ redis:
|
|||||||
default:
|
default:
|
||||||
port: 6379 # Redis port
|
port: 6379 # Redis port
|
||||||
host: "127.0.0.1" # Redis host
|
host: "127.0.0.1" # Redis host
|
||||||
password: "<密码>"
|
password: "<password>"
|
||||||
db: 0 # Redis db_num
|
db: 0 # Redis db_num
|
||||||
# 多个数据源时可以用这个指定默认的数据源
|
# 多个数据源时可以用这个指定默认的数据源
|
||||||
defaultDataSourceName: "default"
|
defaultDataSourceName: "default"
|
||||||
|
|||||||
@@ -6,27 +6,27 @@ server:
|
|||||||
# security 安全
|
# security 安全
|
||||||
security:
|
security:
|
||||||
csrf:
|
csrf:
|
||||||
# 允许调用的域名地址的,例如:http://<Referer地址>/
|
# 允许调用的域名地址的,例如:http://<Referer>/
|
||||||
refererWhiteList:
|
refererWhiteList:
|
||||||
- "127.0.0.1"
|
- "127.0.0.1"
|
||||||
- "<Referer地址>"
|
- "<Referer>"
|
||||||
|
|
||||||
# GORM 数据源
|
# GORM 数据源
|
||||||
gorm:
|
gorm:
|
||||||
dataSource:
|
dataSource:
|
||||||
default:
|
default:
|
||||||
type: "mysql"
|
type: "mysql"
|
||||||
host: "<mysql地址>"
|
host: "<mysql host>"
|
||||||
port: 3306
|
port: 3306
|
||||||
username: "<用户名>"
|
username: "<mysql username>"
|
||||||
password: "<密码>"
|
password: "<mysql password>"
|
||||||
database: "<数据库>"
|
database: "<mysql database>"
|
||||||
|
|
||||||
# Redis 缓存数据
|
# Redis 缓存数据
|
||||||
redis:
|
redis:
|
||||||
dataSource:
|
dataSource:
|
||||||
default:
|
default:
|
||||||
port: 6379 # Redis port
|
port: 6379 # Redis port
|
||||||
host: "<redis地址>"
|
host: "<redis host>"
|
||||||
password: "<密码>"
|
password: "<redis password>"
|
||||||
db: 0 # Redis db_num
|
db: 0 # Redis db_num
|
||||||
|
|||||||
Reference in New Issue
Block a user