fix(passport): 修正邀请信息接口请求参数与请求头
- 将邀请令牌作为查询参数附加在请求URL中 - 移除请求体中的token字段传递 - 添加请求头TenantId,值为5 - 请求失败时在控制台打印错误信息以便调试 - 保持原有错误处理和加载状态设置逻辑不变
This commit is contained in:
@@ -75,10 +75,12 @@ const InvitePage: React.FC = () => {
|
|||||||
const fetchInviteInfo = async (inviteToken: string) => {
|
const fetchInviteInfo = async (inviteToken: string) => {
|
||||||
try {
|
try {
|
||||||
const res = await Taro.request({
|
const res = await Taro.request({
|
||||||
url: `${SERVER_API_URL}/api/_app/developer/invite/info`,
|
url: `${SERVER_API_URL}/api/_app/developer/invite/info?token=${encodeURIComponent(inviteToken)}`,
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
data: { token: inviteToken },
|
header: {
|
||||||
header: { 'content-type': 'application/json' }
|
'content-type': 'application/json',
|
||||||
|
'TenantId': 5
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (res.data.code === 200 || res.data.code === 0) {
|
if (res.data.code === 200 || res.data.code === 0) {
|
||||||
@@ -87,6 +89,7 @@ const InvitePage: React.FC = () => {
|
|||||||
setError(res.data.message || '邀请信息获取失败');
|
setError(res.data.message || '邀请信息获取失败');
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
console.error('获取邀请信息失败:', err);
|
||||||
setError(err.message || '网络请求失败');
|
setError(err.message || '网络请求失败');
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user