Browse Source

Merge branch 'pool/haitong' into debug

# Conflicts:
#	services/wechat_send_msg.go
Roc 7 months ago
parent
commit
d5fb4cfc49
2 changed files with 19 additions and 6 deletions
  1. 8 5
      services/wechat_send_msg.go
  2. 11 1
      utils/config.go

+ 8 - 5
services/wechat_send_msg.go

@@ -99,15 +99,18 @@ 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 if sendInfo.RedirectTarget == 4 {
+			case 4:
 				xcxAppId = utils.WxCopyYbAppId
-			} else {
+			case 5:
+				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"]
 	}
 	//日志配置
 	{