代码自动迁移动态适配

修改
- server/config.yaml
- server/config/config.go
- server/config/viper.go
- server/service/sys_auto_code.go
新增
- server/config/auto_code.go
This commit is contained in:
songzhibin97
2021-03-09 14:59:20 +08:00
parent 26dbd1446c
commit 45d552ac8c
5 changed files with 66 additions and 25 deletions

View File

@@ -6,9 +6,11 @@ import (
"gin-vue-admin/global"
_ "gin-vue-admin/packfile"
"gin-vue-admin/utils"
"os"
"path/filepath"
"github.com/fsnotify/fsnotify"
"github.com/spf13/viper"
"os"
)
func Viper(path ...string) *viper.Viper {
@@ -46,9 +48,9 @@ func Viper(path ...string) *viper.Viper {
fmt.Println(err)
}
})
if err := v.Unmarshal(&global.GVA_CONFIG); err != nil {
fmt.Println(err)
}
global.GVA_CONFIG.AutoCode.Root, _ = filepath.Abs("..")
return v
}