Commit f99ef3bf authored by wangxl's avatar wangxl

2222

parent c5f18317
......@@ -293,7 +293,7 @@ export function changeProjType (type) {
new Promise(async (resolve, reject) => {
try {
this.$store.commit('app/clearStore')
setType(type)
setType(type + '')
this.$store.commit('app/setProjType', type)
let menuList = JSON.parse(window.sessionStorage.getItem('menuList'))
this.$store.commit('app/initStore', [menuList[0].id])
......@@ -329,6 +329,10 @@ router.beforeEach(async (to, from, next) => {
NProgress.done()
}
} else {
if (!!!hasUser.projType) {
setType(hasUser.type + '')
this.$store.commit('app/setProjType', hasUser.type)
}
await store.dispatch('app/auth', to.path)
next()
NProgress.done()
......
// @ts-nocheck
import router from '@/router'
import api from '@/api'
import { getType, setType } from '@/views/utils/auth'
import { getType } from '@/views/utils/auth'
const state = {
......@@ -20,8 +20,6 @@ const actions = {
try {
window.sessionStorage.setItem('user', JSON.stringify(data.userInfo))
window.sessionStorage.setItem('menuList', JSON.stringify(data.menuList))
setType(hasUser.type)
this.commit('app/setProjType', hasUser.type)
this.commit('app/setComplete', data.complete)
this.commit('app/initStore', [data.menuList[0].id])
resolve(data)
......
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