|
|
@ -19,8 +19,8 @@ _axios.defaults.headers.delete['Content-Type'] = 'application/json;charset=UTF-8 |
|
|
|
|
|
|
|
|
|
|
|
let logout; |
|
|
|
let logout; |
|
|
|
|
|
|
|
|
|
|
|
export const registerRouter = routerP => { |
|
|
|
export const registerRouter = (routerP) => { |
|
|
|
router = routerP; |
|
|
|
router = routerP; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Add a request interceptor
|
|
|
|
// Add a request interceptor
|
|
|
@ -37,6 +37,9 @@ _axios.interceptors.request.use( |
|
|
|
delEmpty(data); |
|
|
|
delEmpty(data); |
|
|
|
data.t = time; |
|
|
|
data.t = time; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (data != null && typeof data === 'string') { |
|
|
|
|
|
|
|
config.headers['Content-Type'] = 'text/plain;charset=UTF-8'; |
|
|
|
|
|
|
|
} |
|
|
|
return config; |
|
|
|
return config; |
|
|
|
}, |
|
|
|
}, |
|
|
|
function (error) { |
|
|
|
function (error) { |
|
|
@ -160,7 +163,7 @@ function handResponse(response, resolve, noMsg, noLoading) { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (response.message == 'session timeout') { |
|
|
|
if (response.message == 'session timeout') { |
|
|
|
router?.push('/login'); |
|
|
|
router?.push('/login'); |
|
|
|
} |
|
|
|
} |
|
|
|
if (response.message == 'no permission') { |
|
|
|
if (response.message == 'no permission') { |
|
|
|
response.message = t('http.unPermission'); |
|
|
|
response.message = t('http.unPermission'); |
|
|
|