12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package controllers
-
- import (
- "wechat-conf/utils"
-
- "github.com/astaxie/beego/config"
- )
-
-
- const (
- AppConf = "app"
- AliYunConf = "aliyun"
- WeChatConf = "wechat"
- SMSConf = "sms"
- )
-
- func (c *BaseController) initConfig() {
-
-
- 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
- }
-
-
- wechatConf, _ := utils.GetConfiger("conf/wechat.conf")
- if wechatConf != nil {
- c.Configer[WeChatConf] = wechatConf
- }
- }
|