1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package controllers
-
- import (
- "spaceofcheng/services/utils"
-
- "github.com/astaxie/beego/config"
- )
-
- // 配置文件列表
- const (
- AppConf = "app"
- AliYunConf = "aliyun"
- WeChatConf = "wechat"
- SMSConf = "sms"
- )
-
- func (c *BaseController) initConfig() {
- // c.RunMode = beego.AppConfig.String("runmode")
-
- if c.Configer == nil {
- c.Configer = make(map[string]config.Configer)
- }
-
- // 系统
- appConf, _ := utils.GetConfiger("conf/app.conf")
- if appConf != nil {
- c.Configer[AppConf] = appConf
- }
-
- c.RunMode = appConf.String("runmode")
-
- // 阿里云
- aliConf, _ := utils.GetConfiger("conf/aliyun.conf")
- if aliConf != nil {
- c.Configer[AliYunConf] = aliConf
- }
-
- // 短信
- smsConf, _ := utils.GetConfiger("conf/sms.conf")
- if smsConf != nil {
- c.Configer[SMSConf] = smsConf
- }
- utils.ResetSMSEngine(smsConf)
-
- // 微信
- wechatConf, _ := utils.GetConfiger("conf/wechat.conf")
- if wechatConf != nil {
- c.Configer[WeChatConf] = wechatConf
- }
- }
|