Browse Source

fix:save 19

jimmyyem 5 months ago
parent
commit
983b4899d9

+ 2 - 1
internal/logic/chatrecords/get_api_recommend_chat_logic.go

@@ -54,9 +54,10 @@ func (l *GetApiRecommendChatLogic) GetApiRecommendChat(req *types.ChatRecommendR
 			return nil, dberrorhandler.DefaultEntError(l.Logger, err, req)
 		}
 
+		questionList := make([]string, 0, recommendCount)
 		recommendList := make([]string, 0, recommendCount)
 		for _, val := range list {
-			recommendList = append(recommendList, val.Content)
+			questionList = append(questionList, val.Content)
 		}
 
 		//TODO 这里根据历史记录返回推荐内容

+ 10 - 2
internal/logic/wxcard/get_api_wx_card_qrcode_logic.go

@@ -5,6 +5,7 @@ import (
 	"fmt"
 	"io"
 	"net/http"
+	"net/url"
 	"strconv"
 	"wechat-api/hook/wechat"
 
@@ -39,10 +40,17 @@ func (l *GetApiWxCardQrcodeLogic) GetApiWxCardQrcode(req *types.QrcodeReq, w htt
 		return
 	}
 
+	// Urldecode 操作
+	rawPath, _ := url.QueryUnescape(req.Path)
+
+	// 从解析后的URL里获取信息
+	parser, _ := url.Parse(rawPath)
+	//fmt.Printf("path=%v, query_string=%v\n", parser.Path, parser.RawQuery)
+
 	pphash := power.HashMap{}
 	resp, err := app.WXACode.GetUnlimited(
-		"share",
-		req.Path,
+		parser.RawQuery,
+		parser.Path,
 		false,
 		req.EnvVersion,
 		req.Width,