Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
fix: 修复微信授权
Nevin5a8cc861b937
diff --git a/aitoearn_web/server/aitoearn-channel/src/core/plat/wxPlat/wxPlat.service.ts b/aitoearn_web/server/aitoearn-channel/src/core/plat/wxPlat/wxPlat.service.tsindex de44cef2..9014a4f5 100644--- a/aitoearn_web/server/aitoearn-channel/src/core/plat/wxPlat/wxPlat.service.ts+++ b/aitoearn_web/server/aitoearn-channel/src/core/plat/wxPlat/wxPlat.service.ts@@ -64,7 +64,7 @@ export class WxPlatService {) {const taskId = uuidv4();- const authUrl = await this.getAuthPageUrl(data.type);+ const authUrl = await this.getAuthPageUrl(data.type, taskId);if (!authUrl)throw new AppException(ExceptionCode.File, '不存在平台授权令牌');@@ -104,10 +104,11 @@ export class WxPlatService {/*** 获取授权页面链接* @param type+ * @param stat* @returns*/- async getAuthPageUrl(type: 'h5' | 'pc'): Promise<string> {- const res = await this.myWxPlatApiService.getAuthPageUrl(type);+ async getAuthPageUrl(type: 'h5' | 'pc', stat?: string): Promise<string> {+ const res = await this.myWxPlatApiService.getAuthPageUrl(type, stat);if (!res)throw new AppException(ExceptionCode.File, '不存在平台授权令牌');diff --git a/aitoearn_web/server/aitoearn-channel/src/libs/myWxPlat/myWxPlatApi.service.ts b/aitoearn_web/server/aitoearn-channel/src/libs/myWxPlat/myWxPlatApi.service.tsindex 115075b5..d7e497e5 100644--- a/aitoearn_web/server/aitoearn-channel/src/libs/myWxPlat/myWxPlatApi.service.ts+++ b/aitoearn_web/server/aitoearn-channel/src/libs/myWxPlat/myWxPlatApi.service.ts@@ -24,19 +24,18 @@ export class MyWxPlatApiService {/*** 获取授权链接- * @param preAuthCode- * @param redirectUri* @param type+ * @param stat 透传数据* @returns*/- async getAuthPageUrl(type: 'h5' | 'pc') {+ async getAuthPageUrl(type: 'h5' | 'pc', stat?: string) {try {const result = await axios.get<{data: stringcode: stringmessgage: string}>(- `${this.hostUrl}/wxPlat/auth/url/${this.id}?type=${type}`,+ `${this.hostUrl}/wxPlat/auth/url?type=${type}&key=${this.id}&stat=${stat}`,{headers: {'Content-Type': 'application/json',@@ -50,7 +49,7 @@ export class MyWxPlatApiService {return result.data.data}catch (error) {- Logger.error('------ Error wxPlat getQueryAuth: ------', error)+ Logger.error('------ Error wxPlat getAuthPageUrl: ------', error)return null}}