fix(config): 修正环境配置中的API_BASE_URL地址

- 将开发环境、生产环境和测试环境的API_BASE_URL统一更新为新的域名websopy-api.websoft.top
- 更新SimpleQRCodeModal组件中二维码请求地址,使用新的API域名
- 在邀请信息请求函数fetchInviteInfo中添加详细的请求和响应日志
- 增加接口错误日志打印,提高捕获异常时的信息丰富度
This commit is contained in:
2026-04-11 19:03:45 +08:00
parent 699ff9c01e
commit b6105d65e9
3 changed files with 13 additions and 5 deletions

View File

@@ -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',
}

View File

@@ -81,7 +81,7 @@ const SimpleQRCodeModal: React.FC<SimpleQRCodeModalProps> = ({
{qrContent ? (
<View className={'flex flex-col justify-center'}>
<img
src={`https://mp-api.websoft.top/api/qr-code/create-encrypted-qr-image?size=300x300&expireMinutes=60&businessType=gift&data=${encodeURIComponent(qrContent)}`}
src={`https://websopy-api.websoft.top/api/qr-code/create-encrypted-qr-image?size=300x300&expireMinutes=60&businessType=gift&data=${encodeURIComponent(qrContent)}`}
alt="二维码"
style={{width: '200px', height: '200px'}}
className="mx-auto"

View File

@@ -75,6 +75,10 @@ const InvitePage: React.FC = () => {
*/
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);