Skip to content

Commit

Permalink
fix:修复了正方服务器的200506报错显示 (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
xixiIBN5100 authored Sep 20, 2024
1 parent a32dfd7 commit 20c460a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
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

0 comments on commit 20c460a

Please sign in to comment.