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

优化

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