123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- package utils
- import (
- "fmt"
- "github.com/astaxie/beego"
- "rdluck_tools/cache"
- )
- var (
- RunMode string //运行模式
- MYSQL_URL string //数据库连接
- MYSQL_URL_INDUSTRY string //数据库连接
- REDIS_CACHE string //缓存地址
- Rc *cache.Cache //redis缓存
- Re error //redis错误
- )
- //微信配置信息
- var (
- WxId string //微信原始ID
- WxAppId string
- WxAppSecret string
- RemindTemplateId string
- )
- func init() {
- RunMode = beego.AppConfig.String("run_mode")
- config, err := beego.AppConfig.GetSection(RunMode)
- if err != nil {
- panic("配置文件读取错误 " + err.Error())
- }
- beego.Info(RunMode + " 模式")
- MYSQL_URL = config["mysql_url"]
- MYSQL_URL_INDUSTRY = config["mysql_url_industry"]
- REDIS_CACHE = config["beego_cache"]
- if len(REDIS_CACHE) <= 0 {
- panic("redis链接参数没有配置")
- }
- Rc, Re = cache.NewCache(REDIS_CACHE) //初始化缓存
- if Re != nil {
- fmt.Println(Re)
- panic(Re)
- }
- if RunMode == "release" {
- WxAppId = "wx783118ccac2e9fd3"
- WxAppSecret = "INbwN7p8ywpToc1iHpRunDjUJSqA4OTa5jcZYaQC0gE"
- WxId = "gh_b67e0049fb8c"
- } else {
- WxAppId = "wx9b5d7291e581233a"
- WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
- WxId = "gh_5dc508325c6f"
- RemindTemplateId="pDk4o924gSZWj80ZdNnHodnLMIXjPSlKZU0ciQMOhec"
- }
- }
- //http://adminapi.brilliantstart.cn/admin/
- //http://adminapi.brilliantstart.cn/swagger/
- //http://139.196.122.219:8602/swagger/
|