This commit is contained in:
ky_sunl
2021-04-23 06:02:02 +00:00
parent d1c9e5a71e
commit 0704d01146
92 changed files with 23712 additions and 1038160 deletions

View File

@@ -38,14 +38,14 @@ const initInstance = (options) => {
return instance
}
const errerCodes = [status.BadRequest, status.InternalServerError]
const errerCodes = [status.BadRequest, status.InternalServerError, status.Forbidden]
const errorNotification = ({ code, message }) => {
switch (message.constructor) {
case Array:
message.map(p => {
app.$notification.error({
duration: 0,
duration: 30000,
message: p.field,
description: p.messages.join('/'),
})
@@ -53,7 +53,7 @@ const errorNotification = ({ code, message }) => {
break
default:
app.$notification.error({
duration: 0,
duration: 30000,
message: code || '错误',
description: message,
})
@@ -83,7 +83,7 @@ for (let key in urls) {
if (item[1]) {
method = item[1].toLowerCase()
}
if(item[2]) {
if (item[2]) {
options = item[2]
}
} else if (item.constructor === Object) {

View File

@@ -39,6 +39,7 @@ const doLogin = (args) => {
if (typeof message === 'object' && message[0]) {
app.$message.error(message[0].messages[0])
}
reject()
})
})
}

View File

@@ -39,7 +39,7 @@ export default {
doLogin({
account: this.form.user,
password: this.form.password,
}).then(() => {
}).finally(() => {
this.loading = false;
});
},

View File

@@ -33,7 +33,7 @@ export default {
},
appActived() {
return this.apps.find((p) => p.active);
return this.apps.find((p) => p.active) || {};
},
},