feat: migrate app routes and business modules
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
export const getRequestErrorMessage = (error, fallback = '操作未完成,请稍后再试。') => {
|
||||
if (error?.code === 'NETWORK_ERROR' || error?.code === 'REQUEST_TIMEOUT') {
|
||||
return '网络不太稳定,请检查网络后重试。'
|
||||
}
|
||||
if (error?.code === 'BUSINESS_ERROR' && Number(error.businessCode) === 401) {
|
||||
return '登录状态已失效,请重新登录。'
|
||||
}
|
||||
if (error?.code === 'BUSINESS_ERROR' && Number(error.businessCode) === 403) {
|
||||
return '暂时没有权限进行这项操作。'
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
Reference in New Issue
Block a user