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 4
4
"fmt"
5
5
"path/filepath"
6
6
7
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
8
+
7
9
"github.com/flipped-aurora/gin-vue-admin/server/config"
8
10
"github.com/flipped-aurora/gin-vue-admin/server/global"
9
11
model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
@@ -20,7 +22,10 @@ import (
20
22
// Author [songzhibin97](https://github.com/songzhibin97)
21
23
func (initDBService * InitDBService ) writeMysqlConfig (mysql config.Mysql ) error {
22
24
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
+ }
24
29
global .GVA_VP .Set ("jwt.signing-key" , uuid .NewV4 ().String ())
25
30
return global .GVA_VP .WriteConfig ()
26
31
}
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ package system
3
3
import (
4
4
"path/filepath"
5
5
6
+ "github.com/flipped-aurora/gin-vue-admin/server/utils"
7
+
6
8
"github.com/flipped-aurora/gin-vue-admin/server/config"
7
9
"github.com/flipped-aurora/gin-vue-admin/server/global"
8
10
model "github.com/flipped-aurora/gin-vue-admin/server/model/system"
@@ -19,7 +21,10 @@ import (
19
21
func (initDBService * InitDBService ) writePgsqlConfig (pgsql config.Pgsql ) error {
20
22
global .GVA_CONFIG .System .DbType = "pgsql"
21
23
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
+ }
23
28
global .GVA_VP .Set ("jwt.signing-key" , uuid .NewV4 ().String ())
24
29
return global .GVA_VP .WriteConfig ()
25
30
}
You can’t perform that action at this time.
0 commit comments