12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- package utils
- import (
- "fmt"
- "github.com/beego/beego/v2/core/logs"
- "github.com/beego/beego/v2/server/web"
- )
- var (
- RunMode string //运行模式
- MYSQL_URL string //数据库连接
- MYSQL_URL_RDDP string //数据库连接
- )
- //微信配置信息
- var (
- WxId string //微信原始ID
- WxAppId string
- WxAppSecret string
- TemplateIdByProduct string //产品运行报告通知-模板ID
- TemplateRedirectUrl string //模板消息跳转地址
- WxPlatform int //用户来源,需要入库,用来保存该用户来自哪个平台,默认是:1
- TemplateIdByCompanyApply string //客户申请单审批通知-模板ID
- //微信小程序appid
- WxId2 string //微信原始ID
- WxAppId2 string
- WxAppSecret2 string
- WxPlatform2 int //用户来源,需要入库,用来保存该用户来自哪个平台,默认是:1
- )
- var (
- STATIC_DIR string
- )
- var (
- Bucketname string = "hongze"
- Endpoint string
- Imghost string = "https://hongze.oss-accelerate.aliyuncs.com/"
- Upload_dir string = "static/images/"
- Upload_Audio_Dir string = "static/audio/"
- AccessKeyId string = "LTAIFMZYQhS2BTvW"
- AccessKeySecret string = "12kk1ptCHoGWedhBnKRVW5hRJzq9Fq"
- )
- func init() {
- tmpRunMode, err := web.AppConfig.String("run_mode")
- if err != nil {
- panic("配置文件读取run_mode错误 " + err.Error())
- }
- RunMode = tmpRunMode
- fmt.Println(RunMode, "模式")
- config, err := web.AppConfig.GetSection(RunMode)
- if err != nil {
- panic("配置文件读取错误 " + err.Error())
- }
- logs.Info(RunMode + " 模式")
- MYSQL_URL = config["mysql_url"]
- MYSQL_URL_RDDP = config["mysql_url_rddp"]
- //小程序appid配置
- WxAppId2 = `wx67b68e39913e511e`
- WxId2 = `wx67b68e39913e511e`
- WxAppSecret2 = `660b0375f701a19220bb8a662b41c77c`
- WxPlatform2 = 5
- if RunMode == "release" {
- WxAppId = "wx4a844c734d8c8e56"
- WxAppSecret = "26c586e7ccb3c575433f0f37797b3eeb"
- WxId = "gh_b67e0049fb8c"
- TemplateIdByProduct = "Cp2wF8gvBtxyWV4DeYuI172oqwyYXVRSm3AyJO42d84"
- TemplateRedirectUrl = "https://ficc.hzinsights.com/reportdtl?id="
- WxPlatform = 1
- TemplateIdByCompanyApply = "ZKcOfNIWBpwHJxpptufHIK1mp2nIwkT3cxub-35cFqI"
- //oss
- STATIC_DIR = "/home/static/imgs/"
- Endpoint = "oss-cn-shanghai-internal.aliyuncs.com"
- } else {
- WxAppId = "wx9b5d7291e581233a"
- WxAppSecret = "f4d52e34021eee262dce9682b31f8861"
- WxId = "gh_5dc508325c6f"
- TemplateIdByProduct = "-YjuPOB7Fqd-S3ilabYa6wvjDY9aXmeEfPN6DCiy-EY"
- TemplateRedirectUrl = "http://rddpweb.brilliantstart.cn/reportdtl?id="
- WxPlatform = 1
- TemplateIdByCompanyApply = "eTalI1LbiT_B0mTaBeDTlfSMITenK8dQIgEB5yqjjvA"
- //oss配置
- STATIC_DIR = "static/imgs/"
- Endpoint = "oss-cn-shanghai.aliyuncs.com"
- }
- }
- //http://webapi.brilliantstart.cn/api/
- //http://webapi.brilliantstart.cn/swagger/
- //http://139.196.122.219:8603/swagger/
|