From 0ac81a4405d4effed100d15fed9634d37d0aa6f0 Mon Sep 17 00:00:00 2001 From: jager Date: Wed, 22 Dec 2021 17:07:40 +0800 Subject: [PATCH] modify config --- cmd/stock/main.go | 1 + wxgzh/wxgzh.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/cmd/stock/main.go b/cmd/stock/main.go index 4863500..19654b0 100644 --- a/cmd/stock/main.go +++ b/cmd/stock/main.go @@ -30,6 +30,7 @@ func main() { defer logx.Sync() msg.Init() // 企业微信或者钉钉群通知初始化,即根据配置文件中的配置设置钉钉机器人的密钥,URL和企业微信的URL tianapi.SetKey(cfg.TianApiKey) // 天行数据API初始化 + wxgzh.InitCfg(cfg.WxgzhAppid, cfg.WxgzhSecret) ctx, cancel := contextx.Default() defer cancel() diff --git a/wxgzh/wxgzh.go b/wxgzh/wxgzh.go index 396065e..29ea459 100644 --- a/wxgzh/wxgzh.go +++ b/wxgzh/wxgzh.go @@ -37,6 +37,11 @@ var ( expiresIn int64 ) +func InitCfg(appid_, secret_ string) { + appid = appid_ + secret = secret_ +} + type Resp struct { Errcode int `json:"errcode"` Errmsg string `json:"errmsg"`