新增错误提示

This commit is contained in:
2026-03-11 15:40:31 +08:00
parent c9354c02b7
commit 220725206f
11 changed files with 19077 additions and 3 deletions

View File

@@ -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);
}
};