From b6105d65e96fa7a90d48789e7dd19476944a62a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Sat, 11 Apr 2026 19:03:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(config):=20=E4=BF=AE=E6=AD=A3=E7=8E=AF?= =?UTF-8?q?=E5=A2=83=E9=85=8D=E7=BD=AE=E4=B8=AD=E7=9A=84API=5FBASE=5FURL?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将开发环境、生产环境和测试环境的API_BASE_URL统一更新为新的域名websopy-api.websoft.top - 更新SimpleQRCodeModal组件中二维码请求地址,使用新的API域名 - 在邀请信息请求函数fetchInviteInfo中添加详细的请求和响应日志 - 增加接口错误日志打印,提高捕获异常时的信息丰富度 --- config/env.ts | 6 +++--- src/components/SimpleQRCodeModal.tsx | 2 +- src/passport/invite/index.tsx | 10 +++++++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/config/env.ts b/config/env.ts index f230b12..763962d 100644 --- a/config/env.ts +++ b/config/env.ts @@ -3,19 +3,19 @@ export const ENV_CONFIG = { // 开发环境 development: { // API_BASE_URL: 'http://127.0.0.1:9200/api', - API_BASE_URL: 'https://mp-api.websoft.top/api', + API_BASE_URL: 'https://websopy-api.websoft.top/api', APP_NAME: '开发环境', DEBUG: 'true', }, // 生产环境 production: { - API_BASE_URL: 'https://mp-api.websoft.top/api', + API_BASE_URL: 'https://websopy-api.websoft.top/api', APP_NAME: '网宿软件', DEBUG: 'false', }, // 测试环境 test: { - API_BASE_URL: 'https://mp-api.websoft.top/api', + API_BASE_URL: 'https://websopy-api.websoft.top/api', APP_NAME: '测试环境', DEBUG: 'true', } diff --git a/src/components/SimpleQRCodeModal.tsx b/src/components/SimpleQRCodeModal.tsx index 1acde23..84cb288 100644 --- a/src/components/SimpleQRCodeModal.tsx +++ b/src/components/SimpleQRCodeModal.tsx @@ -81,7 +81,7 @@ const SimpleQRCodeModal: React.FC = ({ {qrContent ? ( 二维码 { */ const fetchInviteInfo = async (inviteToken: string) => { try { + console.log('开始获取邀请信息, token:', inviteToken); + console.log('请求URL:', `${SERVER_API_URL}/api/_app/developer/invite/info?token=${encodeURIComponent(inviteToken)}`); + console.log('请求头:', { 'content-type': 'application/json', TenantId }); + const res = await Taro.request({ url: `${SERVER_API_URL}/api/_app/developer/invite/info?token=${encodeURIComponent(inviteToken)}`, method: 'GET', @@ -84,13 +88,17 @@ const InvitePage: React.FC = () => { } }); + console.log('邀请信息接口响应:', res); + console.log('响应数据:', res.data); + if (res.data.code === 200 || res.data.code === 0) { setInviteInfo(res.data.data); } else { + console.error('接口返回错误:', res.data.message, 'code:', res.data.code); setError(res.data.message || '邀请信息获取失败'); } } catch (err: any) { - console.error('获取邀请信息失败:', err); + console.error('获取邀请信息异常:', err); setError(err.message || '网络请求失败'); } finally { setLoading(false);