mirror of
https://github.com/whyour/qinglong.git
synced 2026-07-17 09:34:31 +08:00
统一api错误提示
This commit is contained in:
@@ -101,7 +101,7 @@ export default function (props: any) {
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (systemInfo && systemInfo.isInitialized && !user) {
|
||||
if (systemInfo && systemInfo.isInitialized && !user.username) {
|
||||
getUser();
|
||||
}
|
||||
}, [props.location.pathname]);
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ const time = Date.now();
|
||||
const errorHandler = function (error: any) {
|
||||
if (error.response) {
|
||||
const msg = error.data
|
||||
? error.data.message || error.data
|
||||
? error.data.message || error.message || error.data
|
||||
: error.response.statusText;
|
||||
const responseStatus = error.response.status;
|
||||
if ([502, 504].includes(responseStatus)) {
|
||||
|
||||
Reference in New Issue
Block a user