浏览代码

fix:添加海通小程序

Roc 7 月之前
父节点
当前提交
832a7a53d5
共有 2 个文件被更改,包括 18 次插入5 次删除
  1. 7 4
      services/wechat_send_msg.go
  2. 11 1
      utils/config.go

+ 7 - 4
services/wechat_send_msg.go

@@ -99,13 +99,16 @@ func SendWxTemplateMsg(sendInfo *models.SendWxTemplate) (err error) {
 			sendMap["url"] = sendInfo.RedirectUrl
 		} else {
 			var xcxAppId string
-			if sendInfo.RedirectTarget == 1 {
+			switch sendInfo.RedirectTarget {
+			case 1:
 				xcxAppId = utils.WxYbAppId
-			} else if sendInfo.RedirectTarget == 2 {
+			case 2:
 				xcxAppId = utils.WxCrmAppId
-			} else if sendInfo.RedirectTarget == 3 {
+			case 3:
 				xcxAppId = utils.WxCygxAppId
-			} else {
+			case 4:
+				xcxAppId = utils.WxHtAppId
+			default:
 				err = errors.New("无效的微信小程序跳转方式:RedirectTarget" + strconv.Itoa(sendInfo.RedirectTarget))
 				return err
 			}

+ 11 - 1
utils/config.go

@@ -35,10 +35,12 @@ var (
 	WxAppIdCygx     string
 	WxAppSecretCygx string
 
-
 	WxAppIdMfyx     string
 	WxAppSecretMfyx string
 
+	WxAppIdHt     string // 海通公众号的appid
+	WxAppSecretHt string // 海通公众号的签名秘钥
+
 	// 小程序相关
 
 	// WxCrmAppId 随手办公小程序
@@ -51,6 +53,8 @@ var (
 	WxCopyYbAppId string
 	// WxMfyxAppId 买方研选小程序
 	WxMfyxAppId string
+
+	WxHtAppId string // 海通小程序
 )
 
 // LibreOfficePath LibreOfficePath的地址
@@ -200,6 +204,12 @@ func init() {
 
 		// WxCopyYbAppId 不知道这是啥,先配置上去吧
 		WxCopyYbAppId = config["wx_copy_yb_miniprogram_appid"]
+
+		// 海通公众号
+		WxAppIdHt = config["wx_ht_appid"]
+		WxAppSecretHt = config["wx_ht_app_secret"]
+		// WxHtAppId 海通小程序
+		WxHtAppId = config["wx_ht_miniprogram_appid"]
 	}
 	//日志配置
 	{