feat: 完成前端业务闭环与后端联调
This commit is contained in:
@@ -2,10 +2,16 @@ export const getRequestErrorMessage = (error, fallback = '操作未完成,请
|
||||
if (error?.code === 'NETWORK_ERROR' || error?.code === 'REQUEST_TIMEOUT') {
|
||||
return '网络不太稳定,请检查网络后重试。'
|
||||
}
|
||||
if (error?.code === 'BUSINESS_ERROR' && Number(error.businessCode) === 401) {
|
||||
if (
|
||||
(error?.code === 'BUSINESS_ERROR' && Number(error.businessCode) === 401) ||
|
||||
(error?.code === 'HTTP_ERROR' && Number(error.httpStatus) === 401)
|
||||
) {
|
||||
return '登录状态已失效,请重新登录。'
|
||||
}
|
||||
if (error?.code === 'BUSINESS_ERROR' && Number(error.businessCode) === 403) {
|
||||
if (
|
||||
(error?.code === 'BUSINESS_ERROR' && Number(error.businessCode) === 403) ||
|
||||
(error?.code === 'HTTP_ERROR' && Number(error.httpStatus) === 403)
|
||||
) {
|
||||
return '暂时没有权限进行这项操作。'
|
||||
}
|
||||
return fallback
|
||||
|
||||
Reference in New Issue
Block a user