Commit 0eeca6f3 by weijiguang

1

parent feb9957b
......@@ -31,8 +31,9 @@ service.interceptors.response.use(
if (headers["content-disposition"]) {
return { file: data, fileName: headers["content-disposition"] };
}
const { code } = data;
const { msg } = data;
const { code, msg } = data;
console.log(code);
console.log(msg);
switch (code) {
case 1:
return data;
......@@ -42,6 +43,7 @@ service.interceptors.response.use(
desc: msg
});
localStorage.removeItem("token");
localStorage.removeItem("tokenInfo");
router.push("/");
return data;
case 3:
......
......@@ -10,22 +10,20 @@ import "./index.less";
Vue.config.productionTip = false;
Vue.use(iView);
// Viewer.setDefaults({
// zIndex: 99999999,
// url(image) {
// return image.getAttribute("url");
// }
// });
// Vue.use(Viewer);
router.beforeEach((to, from, next) => {
if (to.path == "/") { // 判断该路由是否需要登录权限
const tokenInfo = localStorage.getItem("tokenInfo");
if (tokenInfo) {
router.push("/main");
return;
}
next();
} else {
next();
}
})
new Vue({
router,
render: h => h(App)
}).$mount("#app")
// new Vue({
// el: '#app',
// router,
// components: { App },
// template: '<App/>'
// })
......@@ -84,22 +84,20 @@ export const columns = (search, disable, enable, showEditExpired, showEdit, show
}
},
{
title: "省",
key: "province",
title: "地区",
align: "center",
minWidth: 40,
},
{
title: "市",
key: "city",
align: "center",
minWidth: 40,
},
{
title: "区",
key: "district",
align: "center",
minWidth: 40,
minWidth: 80,
render(h, { row }) {
try {
const { province, city, district } = row;
if(province || city || district) {
return h("span", `${province} / ${city} / ${district}`);
}
return h("span", `未知`);
} catch(e) {
console.log(e);
}
}
},
{
title: "状态",
......
......@@ -39,6 +39,21 @@ export default {
}
});
},
clearMenus() {
this.maps = [];
for(var i in routers) {
var router = routers[i];
router.visable = false;
if(!router.children || router.children.length<=0) {
continue;
}
for(var j in router.children) {
var childRouter = router.children[j];
childRouter.visable = false;
}
}
},
getMenuFromRouter(key) {
var maps = [];
for(var i in routers) {
......@@ -82,6 +97,7 @@ export default {
}
},
mounted() {
this.clearMenus();
this.setMenus();
this.onMenuSelect("home");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment