|
@@ -115,7 +115,7 @@ export function getToken() {
|
|
|
|
|
|
export function statusCodesHandler(result, callback) {
|
|
|
if (result.code == statusCode.FAILURE_CODE_7005) {
|
|
|
- return $alert({
|
|
|
+ $alert({
|
|
|
content: "该VR作品待审核,不可编辑。",
|
|
|
forceOK: true,
|
|
|
ok: () => {
|
|
@@ -123,54 +123,64 @@ export function statusCodesHandler(result, callback) {
|
|
|
window.location.href = url
|
|
|
},
|
|
|
});
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_7006) {
|
|
|
- return $alert({
|
|
|
+ $alert({
|
|
|
content: "该VR作品已审核,不可编辑。",
|
|
|
forceOK: true,
|
|
|
ok: () => {
|
|
|
window.location.reload();
|
|
|
},
|
|
|
});
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_3002) {
|
|
|
- return $alert({ content: "请至少保留一个场景。" });
|
|
|
+ $alert({ content: "请至少保留一个场景。" });
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_3003) {
|
|
|
- return $alert({ content: '文件名称不允许超过50个字符' })
|
|
|
+ $alert({ content: '文件名称不允许超过50个字符' })
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_3005) {
|
|
|
- return $alert({ content: "作品已被删除,无法编辑" });
|
|
|
- return;
|
|
|
+ $alert({ content: "作品已被删除,无法编辑" });
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_3006) {
|
|
|
- return $alert({ content: "作品已被删除,无法编辑" });
|
|
|
+ $alert({ content: "作品已被删除,无法编辑" });
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_3007) {
|
|
|
- return $alert({ content: "素材已被引用,无法删除。" });
|
|
|
+ $alert({ content: "素材已被引用,无法删除。" });
|
|
|
+ return
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_5001) {
|
|
|
callback(result.code);
|
|
|
- return showLoginTips();
|
|
|
+ showLoginTips();
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_5003) {
|
|
|
- return $alert({ content: '不支持此图片' })
|
|
|
+ $alert({ content: '不支持此图片' })
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code == statusCode.FAILURE_CODE_5004) {
|
|
|
- return vue.$msg.error("密码错误");
|
|
|
+ vue.$msg.error("密码错误");
|
|
|
+ return false
|
|
|
}
|
|
|
|
|
|
if (result.code != statusCode.SUCCESS) {
|
|
|
- return $alert({ content: `${result.msg}` });
|
|
|
+ $alert({ content: `${result.msg}` });
|
|
|
+ return false
|
|
|
}
|
|
|
return statusCode.NEXT;
|
|
|
}
|
|
@@ -225,13 +235,14 @@ export const http = {
|
|
|
});
|
|
|
|
|
|
if (!flag) {
|
|
|
- return;
|
|
|
+ fail(result)
|
|
|
}
|
|
|
|
|
|
if (flag === statusCode.NEXT) {
|
|
|
done(result, result.code == 0);
|
|
|
}
|
|
|
} else {
|
|
|
+ console.error('ajax返回数据里咋没有code?')
|
|
|
done(result);
|
|
|
}
|
|
|
});
|