添加配置文件输出

This commit is contained in:
junleea 2025-06-13 13:28:30 +08:00
parent 97704ca8d2
commit 6f3495f0f5
1 changed files with 7 additions and 0 deletions

View File

@ -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
}