This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -39,6 +39,7 @@ const doLogin = (args) => {
|
||||
if (typeof message === 'object' && message[0]) {
|
||||
app.$message.error(message[0].messages[0])
|
||||
}
|
||||
reject()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
doLogin({
|
||||
account: this.form.user,
|
||||
password: this.form.password,
|
||||
}).then(() => {
|
||||
}).finally(() => {
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
},
|
||||
|
||||
appActived() {
|
||||
return this.apps.find((p) => p.active);
|
||||
return this.apps.find((p) => p.active) || {};
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user