```
fix(qr-login):优化二维码登录确认逻辑与错误提示 - 调整 confirmWechatQRLogin 接口返回类型,去除冗余日志输出 - 修改登录确认判断条件为 status === 'confirmed'- 更新成功与失败时的提示信息,提升用户体验 -优化错误处理文案,移除不必要的数字前缀```
This commit is contained in:
@@ -158,17 +158,16 @@ export async function confirmWechatQRLogin(token: string, userId: number) {
|
||||
deviceInfo: await getDeviceInfo()
|
||||
};
|
||||
|
||||
const res = await request.post<ApiResult<ConfirmLoginResult>>(
|
||||
const res = await request.post<ApiResult<any>>(
|
||||
SERVER_API_URL + '/qr-login/confirm',
|
||||
data
|
||||
);
|
||||
console.log(res,'ConfirmLoginParamResult>')
|
||||
if (res.code === 0 && res.data) {
|
||||
return res.data;
|
||||
}
|
||||
return Promise.reject(new Error(res.message));
|
||||
} catch (error: any) {
|
||||
return Promise.reject(new Error(error.message || '22确认登录失败'));
|
||||
return Promise.reject(new Error(error.message || '确认登录失败'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,12 +111,11 @@ export function useUnifiedQRScan() {
|
||||
}
|
||||
|
||||
const confirmResult = await confirmWechatQRLogin(token, parseInt(userId));
|
||||
|
||||
if (confirmResult.success) {
|
||||
if (confirmResult.status === 'confirmed') {
|
||||
return {
|
||||
type: ScanType.LOGIN,
|
||||
data: confirmResult,
|
||||
message: '登录确认成功'
|
||||
message: '登录成功'
|
||||
};
|
||||
} else {
|
||||
throw new Error(confirmResult.message || '登录确认失败');
|
||||
|
||||
Reference in New Issue
Block a user