提交 fd14c361 authored 作者: 刘旭's avatar 刘旭

优化

上级 df1d40a7
......@@ -43,17 +43,14 @@ router.beforeEach(async (to, from, next) => {
let token = getToken();
if (token) {
if (to.path === '/login' || to.path === '/') {
// console.log('/import/lic', to.path);
next({ path: '/' })
} else {
// if (to.path === '/import/lic') return window.location.href = '/#/import/lic'
if (store.state.menu.menuList.length == 1) {
try {
await store.dispatch('user/getInfo')
await store.dispatch('menu/getMenuList', router)
next({ ...to, replace: true })
} catch (error) {
// if (to.path === '/import/lic') return next({ path: '/import/lic' })
cleanSession();
next({ path: '/login' })
}
......
......@@ -51,11 +51,6 @@ export const actions = {
return new Promise((resolve, reject) => {
getMenuListApi()
.then((res) => {
/* res.data.forEach(item => {
if (item.meta.title === '部门') {
item.children = []
}
}) */
let accessedRoutes;
if (res.code == 200) {
//动态生成路由
......
......@@ -59,9 +59,7 @@ let formData = ref({
designUrl: ''
})
let headers = computed(() => {
return { Authorization: sessionStorage.getItem("token") };
});
let headers = computed(() => ({ Authorization: sessionStorage.getItem("token") }));
let uploadUrl = (res: any) => {
formData.value.url = res.data.url;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论