Преглед изворни кода

debug: 添加OAuth URL构造日志用于调试redirect_uri问题

MyFramework User пре 3 месеци
родитељ
комит
2d741e159a
1 измењених фајлова са 2 додато и 0 уклоњено
  1. 2 0
      server/src/modules/payment/payment.controller.ts

+ 2 - 0
server/src/modules/payment/payment.controller.ts

@@ -318,6 +318,8 @@ router.get('/wechat/oauth-url', async (ctx: Context) => {
   const redirectUri = encodeURIComponent(baseUrl);
   const state = Math.random().toString(36).substring(2, 10);
   const oauthUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=${state}#wechat_redirect`;
+  
+  console.log('[WeChat OAuth] 构造授权链接:', { appId, baseUrl, redirectUri: decodeURIComponent(redirectUri), oauthUrl });
 
   ctx.body = {
     code: 0,