فهرست منبع

fix: 优化请求头中 nonce 的设置逻辑

zqbao 4 ماه پیش
والد
کامیت
39a52ba74d
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      services/knowledge/knowledge.go

+ 1 - 1
services/knowledge/knowledge.go

@@ -73,7 +73,7 @@ func ForwardRequest(c *gin.Context, targetURL string) (responseBody []byte, err
 	nonce := utils.GetRandStringNoSpecialChar(32)
 	timeStamp := time.Now().UnixMilli() / 1000
 	signature := utils.GetSign(global.CONFIG.EtaReport.AppId, global.CONFIG.EtaReport.Secret, nonce, strconv.Itoa(int(timeStamp)))
-	req.Header.Set("nonce", utils.GetRandStringNoSpecialChar(32))
+	req.Header.Set("nonce", nonce)
 	req.Header.Set("timestamp", strconv.Itoa(int(timeStamp)))
 	req.Header.Set("appid", global.CONFIG.EtaReport.AppId)
 	req.Header.Set("signature", signature)