Commit 0eeca6f3 by weijiguang

1

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