Commit c5f18317 authored by wangxl's avatar wangxl

22

parent 4f6354fd
......@@ -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])
......
// @ts-nocheck
import router from '@/router'
import api from '@/api'
import { getType } from '@/views/utils/auth'
import { getType, setType } from '@/views/utils/auth'
const state = {
......@@ -18,8 +18,10 @@ const actions = {
await api.base.getUser().then(({ data = {} }) => {
if (data) {
try {
window.sessionStorage.setItem('user', JSON.stringify(data.userInfo))
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