Browse Source

fix:模板

zqbao 10 months ago
parent
commit
0af849690b
1 changed files with 7 additions and 1 deletions
  1. 7 1
      controllers/wechat.go

+ 7 - 1
controllers/wechat.go

@@ -152,9 +152,15 @@ func (this *WeChatController) SendTemplateMsg() {
 	sendMap["keyword4"] = map[string]interface{}{"value": report.Abstract, "color": "#173177"}
 	var WxAppId = `wxb059c872d79b9967`
 	// var WxAppSecret = `1737c73e9f69a21de1a345b8f0800258`
+	var wxAppPath string
+	if utils.RunMode == "debug" {
+		wxAppPath = fmt.Sprintf("pages-question/answerDetail?id=%d", 3800)
+	} else {
+		wxAppPath = fmt.Sprintf("pages-report/reportDetail/index?id=%d", report.Id)
+	}
 	sendMap["miniprogram"] = map[string]string{
 		"appid":    WxAppId,
-		"pagepath": fmt.Sprintf("pages-report/reportDetail/index?id=%d", report.Id),
+		"pagepath": wxAppPath,
 	}
 	err = services.SendMultiTemplateMsg(sendMap, openIds, 1)
 	if err != nil {