|
|
@@ -1,5 +1,5 @@
|
|
|
import axios from 'axios'
|
|
|
-import { MessageBox, Notification } from 'element-ui'
|
|
|
+import { MessageBox, Message } from 'element-ui'
|
|
|
|
|
|
const service = axios.create({
|
|
|
timeout: 30000
|
|
|
@@ -26,11 +26,10 @@ service.interceptors.response.use(
|
|
|
if (response.data.code === 200) {
|
|
|
return response.data
|
|
|
} else {
|
|
|
- Notification({
|
|
|
+ Message({
|
|
|
type: 'error',
|
|
|
- title: '系统错误',
|
|
|
message: response.data.msg,
|
|
|
- duration: 2000
|
|
|
+ showClose:true,
|
|
|
})
|
|
|
}
|
|
|
} else {
|
|
|
@@ -58,16 +57,16 @@ service.interceptors.response.use(
|
|
|
}
|
|
|
switch (status) {
|
|
|
case 401:
|
|
|
- // MessageBox.alert('认证失效,请重新登录', '', {
|
|
|
- // confirmButtonText: '确定',
|
|
|
- // type: 'warning',
|
|
|
- // showClose: false,
|
|
|
- // center: true,
|
|
|
- // callback: () => {
|
|
|
- // let _url = window.location.origin
|
|
|
- // window.location.href = error.response.data.loginPageUrl + '?redirect_url=' + _url
|
|
|
- // }
|
|
|
- // })
|
|
|
+ MessageBox.alert('认证失效,请重新登录', '', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ type: 'warning',
|
|
|
+ showClose: false,
|
|
|
+ center: true,
|
|
|
+ callback: () => {
|
|
|
+ let _url = window.location.origin
|
|
|
+ window.location.href = error.response.data.loginPageUrl + '?redirect_url=' + _url
|
|
|
+ }
|
|
|
+ })
|
|
|
break
|
|
|
default:
|
|
|
if (!errMsg) {
|