package utils import ( "fmt" "github.com/beego/beego/v2/core/logs" "github.com/beego/beego/v2/server/web" "github.com/rdlucklib/rdluck_tools/log" ) 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 TemplateCompanyApplyRedirectUrl string //审批单模板消息跳转地址 //微信小程序appid WxId2 string //微信原始ID WxAppId2 string WxAppSecret2 string WxPlatform2 int //用户来源,需要入库,用来保存该用户来自哪个平台,默认是:1 ) var ( STATIC_DIR string ) var ApiLog *log.Log // LibreOfficePath LibreOfficePath的地址 var LibreOfficePath 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 if RunMode == "" { RunMode = "release" configPath := `/home/code/config/hongze_mobile_admin/conf/app.conf` err := web.LoadAppConfig("ini", configPath) if err != nil { fmt.Println("web.LoadAppConfig Err:" + err.Error()) } } 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" TemplateCompanyApplyRedirectUrl = "https://ficc.hzinsights.com/approval/approval/list" //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" TemplateCompanyApplyRedirectUrl = "http://advisoryadmin.brilliantstart.cn/approval/approval/list" //oss配置 STATIC_DIR = "static/imgs/" Endpoint = "oss-cn-shanghai.aliyuncs.com" } tmpLibreOfficePath, err := web.AppConfig.String("libreOfficePath") if err != nil { panic("配置文件读取libreOfficePath错误 " + err.Error()) } LibreOfficePath = tmpLibreOfficePath //日志类 if RunMode == "release" { logDir := `/data/rdlucklog/hongze_mobile_admin` ApiLog = log.Init("20060102.api", logDir) } else { ApiLog = log.Init("20060102.api") } } //http://webapi.brilliantstart.cn/api/ //http://webapi.brilliantstart.cn/swagger/ //http://139.196.122.219:8603/swagger/