27 lines
834 B
Go
27 lines
834 B
Go
package initialize
|
|
|
|
import (
|
|
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
|
"github.com/flipped-aurora/gin-vue-admin/server/plugin/wechat-integration/config"
|
|
)
|
|
|
|
// Viper 初始化配置
|
|
func Viper() {
|
|
// 微信配置已经在主配置文件中定义,这里只需要验证
|
|
if global.GVA_CONFIG.Wechat.MiniAppID == "" {
|
|
global.GVA_LOG.Warn("微信小程序 AppID 未配置")
|
|
}
|
|
|
|
// 公众号配置现在从数据库获取,不再从配置文件检查
|
|
global.GVA_LOG.Info("微信集成插件配置验证完成")
|
|
}
|
|
|
|
// GetWechatConfig 获取微信配置
|
|
func GetWechatConfig() config.WechatConfig {
|
|
return config.WechatConfig{
|
|
MiniAppID: global.GVA_CONFIG.Wechat.MiniAppID,
|
|
MiniAppSecret: global.GVA_CONFIG.Wechat.MiniAppSecret,
|
|
// 公众号配置现在从数据库获取,不再从配置文件读取
|
|
}
|
|
}
|