新增错误提示
This commit is contained in:
@@ -266,14 +266,14 @@ export class HttpRequest {
|
||||
} else {
|
||||
try {
|
||||
const resp: any = JSON.parse(xhr.response);
|
||||
const isDevelopment = EDITOR || (typeof window !== 'undefined' && (window.location.hostname.includes('localhost') || window.location.hostname.includes('127.0.0.1')));
|
||||
if (resp.status === "success") {
|
||||
const isDevelopment = EDITOR || (typeof window !== 'undefined' && (window.location.hostname.includes('localhost') || window.location.hostname.includes('127.0.0.1')));
|
||||
if (isDevelopment) {
|
||||
console.log("data:", resp.data);
|
||||
}
|
||||
completeCallback(resp.data);
|
||||
} else {
|
||||
app.manager.ui.showToast(Tools.GetLocalized(resp.msg));
|
||||
app.manager.ui.showToast(Tools.GetLocalized(resp.message));
|
||||
if (errorCallback) errorCallback(resp.data);
|
||||
}
|
||||
// if (Number(resp.code) === 200 || Number(resp.code) === 406) {
|
||||
@@ -292,6 +292,9 @@ export class HttpRequest {
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
const resp: any = JSON.parse(xhr.response);
|
||||
app.manager.ui.showToast(Tools.GetLocalized(resp.message), 3);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user