Browse Source

feat:明确root语义 (#740)

feat:明确root语义 (#740)
main
songzhibin97 3 years ago
committed by GitHub
parent
commit
82d8892b77
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      server/config.yaml
  2. 2
      server/core/viper.go

2
server/config.yaml

@ -72,6 +72,8 @@ local:
# autocode configuration
autocode:
transfer-restart: true
# root 自动适配项目根目录
# 请不要手动配置,他会在项目加载的时候识别出根路径
root: ""
server: /server
server-api: /api/v1/autocode

2
server/core/viper.go

@ -56,6 +56,8 @@ func Viper(path ...string) *viper.Viper {
if err := v.Unmarshal(&global.GVA_CONFIG); err != nil {
fmt.Println(err)
}
// root 适配性
// 根据root位置去找到对应迁移位置,保证root路径有效
global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..")
global.BlackCache = local_cache.NewCache(
local_cache.SetDefaultExpire(time.Second * time.Duration(global.GVA_CONFIG.JWT.ExpiresTime)),

Loading…
Cancel
Save