提交 c7f0c955 authored 作者: CRS's avatar CRS

new

上级 61b3fae5
......@@ -119,7 +119,7 @@ export default {
item.createDate = item.createDate === '' ? '暂无' : this.time(item.createDate);
}
}).catch(err => {
console.log(err);
console.log(err.message);
})
},
// 搜索栏
......
......@@ -27,12 +27,12 @@ axios.interceptors.request.use(function (config) {
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
if (response.data.code === 403 || response.status === 403 ) {
if (response.data.code === 403) {
v.$message.error(response.data.msg);
setTimeout(function () {
router.push({name: 'login'})
}, 500)
} else if (response.data.code === 400 || response.status === 400 ) {
} else if (response.data.code === 400) {
v.$message.error(response.data.msg);
setTimeout(function () {
router.push({name: 'login'})
......@@ -42,7 +42,19 @@ axios.interceptors.response.use(function (response) {
}
}, function (error) {
// 预处理响应错误(error)
// alert(error);
console.log(error.request.status);
if (error.request.status === 403) {
v.$message.error('您没有访问权限!');
setTimeout(function () {
router.push({name: 'login'})
}, 500)
} else if (error.request.status === 400) {
v.$message.error('登录已超时,请重新登陆!');
setTimeout(function () {
router.push({name: 'login'})
}, 500)
}
// console.log(error.splice(error.length - 4,error.length - 1))
return Promise.reject(error);
});
......
......@@ -10,8 +10,8 @@ import axios from '@/services/axios';
* dataType
*/
import qs from 'qs';
const assessma = 'http://120.55.57.35:8078'
// const assessma = 'http://192.168.1.85:8078'
// const assessma = 'http://120.55.57.35:8078'
const assessma = 'http://192.168.1.85:8078'
const server = {
getloginOut(id) { // 用户退出
return axios('/user/loginOut/' + id, {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论