fix version 1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"log"
|
||||
"net"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/conf"
|
||||
@@ -82,6 +83,16 @@ func New(srvKey string) {
|
||||
// 配置校验 服务名称地址及监听地址不能为空
|
||||
conf.NotNil(Spec.Service, Spec.Cache)
|
||||
|
||||
// 数据库配置缺失时 with.Databases 会直接 panic,这里提前给出明确错误
|
||||
if Spec.Databases == nil || len(Spec.Databases.Source) == 0 {
|
||||
log.Fatalln("ERROR: Databases Not Nil")
|
||||
}
|
||||
|
||||
// 渠道与钱包配置缺失会导致下单时解引用空指针,这里提前拦截
|
||||
if Spec.WeChat == nil || Spec.Alipay == nil || Spec.Wallet == nil {
|
||||
log.Fatalln("ERROR: WeChat/Alipay/Wallet Config Not Nil")
|
||||
}
|
||||
|
||||
// 初始化加密SecretKey
|
||||
encipher.New(env.Runtime.JwtSecretKey)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user