添加配置文件输出
This commit is contained in:
parent
97704ca8d2
commit
6f3495f0f5
|
|
@ -4,6 +4,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"gorm.io/gorm"
|
||||
"log"
|
||||
"os"
|
||||
)
|
||||
|
||||
|
|
@ -124,6 +125,12 @@ func ReadConfig(path string) error {
|
|||
Config.SERVER_PORT = "8083" // 默认端口
|
||||
}
|
||||
}
|
||||
configJson, cErr := json.Marshal(Config)
|
||||
if cErr != nil {
|
||||
log.Println("ReadConfig Error encoding config,err :", cErr)
|
||||
} else {
|
||||
log.Println("ReadConfig configJson:", string(configJson))
|
||||
}
|
||||
SigningKey = []byte(Config.TOKEN_SECRET)
|
||||
return err
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue