|
@@ -8,8 +8,8 @@ import router from '../router'
|
|
|
Vue.use(Vuex)
|
|
|
export default new Vuex.Store({
|
|
|
state: {
|
|
|
- ssoToken: 'admin:lengqiang',
|
|
|
- // ssoToken: null,
|
|
|
+ // ssoToken: 'admin:lengqiang',
|
|
|
+ ssoToken: null,
|
|
|
isPreview: false,
|
|
|
lastRoute: '',
|
|
|
isrequestAuth: true, // 是否请求登录校验接口
|
|
@@ -32,7 +32,7 @@ export default new Vuex.Store({
|
|
|
remarksText: '', //备注
|
|
|
bunkObj: {}, // 铺位名称
|
|
|
currentFloor: {}, //当前选中的楼层信息
|
|
|
- accessLevel: 0, //
|
|
|
+ accessLevel: -1, // 权限级别
|
|
|
showView: 1,
|
|
|
},
|
|
|
getters: {
|
|
@@ -123,20 +123,29 @@ export default new Vuex.Store({
|
|
|
// 获取项目列表、userId
|
|
|
async getUserInfo({ commit }, palyload) {
|
|
|
await login({}).then((res) => {
|
|
|
- if (res.result == 'success') {
|
|
|
- commit('STOREACCESSLEVEL', res)
|
|
|
+ // 获取用户当前权限
|
|
|
+ console.log(res)
|
|
|
+ if (res.result === 'success') {
|
|
|
+ commit('STOREACCESSLEVEL', res.level)
|
|
|
+ let level = res.level
|
|
|
+ if (level === 0) {
|
|
|
+ router.push({ path: './home/homepage' })
|
|
|
+ } else {
|
|
|
+ router.push({ path: './group' })
|
|
|
+ }
|
|
|
+ // commit('SETISREQUESTtAUTH', false)
|
|
|
}
|
|
|
- // token校验成功 拿到权限
|
|
|
- //commit("SETISREQUESTtAUTH", true)
|
|
|
- // if (res.permissions.length == 0) {
|
|
|
- // router.push('/404')
|
|
|
- // }
|
|
|
- // commit('SETAUTHMSG', res)
|
|
|
- // } else {
|
|
|
- // commit('SETISREQUESTtAUTH', false)
|
|
|
- // router.push('/404')
|
|
|
- // }
|
|
|
})
|
|
|
+ // token校验成功 拿到权限
|
|
|
+ //commit("SETISREQUESTtAUTH", true)
|
|
|
+ // if (res.permissions.length == 0) {
|
|
|
+ // router.push('/404')
|
|
|
+ // }
|
|
|
+ // commit('SETAUTHMSG', res)
|
|
|
+ // } else {
|
|
|
+ // commit('SETISREQUESTtAUTH', false)
|
|
|
+ // router.push('/404')
|
|
|
+ // }
|
|
|
},
|
|
|
getFloors(context) {
|
|
|
queryFloor({
|