File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 44 "fmt"
55 "path/filepath"
66
7+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
8+
79 "github.com/flipped-aurora/gin-vue-admin/server/config"
810 "github.com/flipped-aurora/gin-vue-admin/server/global"
911 model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
@@ -20,7 +22,10 @@ import (
2022// Author [songzhibin97](https://github.com/songzhibin97)
2123func (initDBService * InitDBService ) writeMysqlConfig (mysql config.Mysql ) error {
2224 global .GVA_CONFIG .Mysql = mysql
23- global .GVA_VP .Set ("mysql" , mysql )
25+ cs := utils .StructToMap (global .GVA_CONFIG )
26+ for k , v := range cs {
27+ global .GVA_VP .Set (k , v )
28+ }
2429 global .GVA_VP .Set ("jwt.signing-key" , uuid .NewV4 ().String ())
2530 return global .GVA_VP .WriteConfig ()
2631}
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ package system
33import (
44 "path/filepath"
55
6+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
7+
68 "github.com/flipped-aurora/gin-vue-admin/server/config"
79 "github.com/flipped-aurora/gin-vue-admin/server/global"
810 model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
@@ -19,7 +21,10 @@ import (
1921func (initDBService * InitDBService ) writePgsqlConfig (pgsql config.Pgsql ) error {
2022 global .GVA_CONFIG .System .DbType = "pgsql"
2123 global .GVA_CONFIG .Pgsql = pgsql
22- global .GVA_VP .Set ("pgsql" , pgsql )
24+ cs := utils .StructToMap (global .GVA_CONFIG )
25+ for k , v := range cs {
26+ global .GVA_VP .Set (k , v )
27+ }
2328 global .GVA_VP .Set ("jwt.signing-key" , uuid .NewV4 ().String ())
2429 return global .GVA_VP .WriteConfig ()
2530}
You can’t perform that action at this time.
0 commit comments