Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:修复了正方服务器的200506报错显示 #105

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/pages/bind/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
</w-list-item>
</w-list>
<w-list class="bind-list" :class="[{ binded: user.isBindLibrary }]" >
<w-list-item :extra="user.isBindLibrary ? '已绑定' : '未绑定'" arrow="down"
@tap="renderForm('library')">
图书馆账号
<!-- <w-list-item :extra="user.isBindLibrary ? '已绑定' : '未绑定'" arrow="down"-->
<!-- @tap="renderForm('library')">-->
<w-list-item :extra="user.isBindLibrary ? '已绑定' : '未绑定'" arrow="down" >
图书馆账号(暂不可用)
</w-list-item>
</w-list>
<w-list class="bind-list" :class="[{ binded: user.isBindYXY }]" >
<w-list-item :extra="user.isBindYXY ? '已绑定' : '未绑定'" arrow="down"
@tap="renderForm('yxy')">
<text> 一卡通账号 </text>
<w-badge> 测试 </w-badge>
</w-list-item>
</w-list>
</card>
Expand Down
3 changes: 2 additions & 1 deletion src/services/api/codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ export const ServerCode = {
UsernamePasswordUnmatched: 200504,
UserNotLogin: 200503,

SystemError: 200500,
SystemError_1: 200500,
SystemError_2: 200506,

activation: {
schoolIdOrIdNotExistNotMatch: 200510,
Expand Down
1 change: 1 addition & 0 deletions src/services/services/userService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export default class UserService {
}
return true;
}
Taro.hideLoading();
await errCodeHandler(res.data.code, true);

return false;
Expand Down
10 changes: 8 additions & 2 deletions src/services/utils/errHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ export default async function errCodeHandler(code: number, showModal = true) {
});
}
break;
case ServerCode.SystemError:
case ServerCode.SystemError_1:
await Taro.showToast({
icon: "none",
title: "服务器暂不可用"
title: "请求超时,请重试"
});
break;
case ServerCode.SystemError_2:
await Taro.showToast({
icon: "none",
title: "请求超时,请重试"
});
break;
case ServerCode.UserAlreadyExisted:
Expand Down
Loading