|
@@ -2,7 +2,7 @@ import Vue from 'vue'
|
|
|
import { login, logout, phoneLogin, thirdLogin, iotSsoLogin, tzLogin } from "@/api/login"
|
|
|
import { ACCESS_TOKEN, USER_NAME,USER_INFO,USER_AUTH,SYS_BUTTON_AUTH,UI_CACHE_DB_DICT_DATA,TENANT_ID,CACHE_INCLUDED_ROUTES } from "@/store/mutation-types"
|
|
|
import { welcome } from "@/utils/util"
|
|
|
-import { queryPermissionsByUser } from '@/api/api'
|
|
|
+import { queryPermissionsByUser, queryInterlockPermissionsByUser } from '@/api/api'
|
|
|
import { getAction } from '@/api/manage'
|
|
|
|
|
|
import cookie from 'js-cookie'
|
|
@@ -93,6 +93,8 @@ const user = {
|
|
|
commit('SET_AVATAR', userInfo.avatar)
|
|
|
|
|
|
cookie.set('EIName', 'system')
|
|
|
+ cookie.set('WISEUser', 'admin') // 本地测试用
|
|
|
+ cookie.set('SSORole', 'globalAdmin') // 本地测试用
|
|
|
|
|
|
resolve(response)
|
|
|
}else{
|
|
@@ -176,6 +178,55 @@ const user = {
|
|
|
})
|
|
|
})
|
|
|
},
|
|
|
+ // 获取iot对应的用户信息--联锁管理
|
|
|
+ GetInterlockPermissionList({ commit }) {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ queryInterlockPermissionsByUser().then(response => {
|
|
|
+
|
|
|
+ // update-begin----author:scott---date:20221018------for: 判断是否是 vue3 版本的菜单,给予提示 ---
|
|
|
+ let routeList = response.result.menu;
|
|
|
+ var findVue3Menu = routeList.find(item => {
|
|
|
+ return item.component === 'layouts/default/index';
|
|
|
+ });
|
|
|
+ if (findVue3Menu) {
|
|
|
+ console.error("启动失败: 检查到当前菜单表是Vue3版本,导致菜单加载异常,请切换到Vue2版菜单!参考:http://doc.jeecg.com/3075165")
|
|
|
+ Vue.prototype.$Jmessage.error('启动失败: 检查到当前菜单表是Vue3版本,导致菜单加载异常,请切换到Vue2版菜单!参考:http://doc.jeecg.com/3075165', 0)
|
|
|
+ }
|
|
|
+ // update-end----author:scott---date:20221018------for: 判断是否是 vue3 版本的菜单,给予提示 ---
|
|
|
+
|
|
|
+
|
|
|
+ const menuData = response.result.menu;
|
|
|
+ const authData = response.result.auth;
|
|
|
+ const allAuthData = response.result.allAuth;
|
|
|
+ //Vue.ls.set(USER_AUTH,authData);
|
|
|
+ sessionStorage.setItem(USER_AUTH,JSON.stringify(authData));
|
|
|
+ sessionStorage.setItem(SYS_BUTTON_AUTH,JSON.stringify(allAuthData));
|
|
|
+ if (menuData && menuData.length > 0) {
|
|
|
+ // //update--begin--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
|
|
|
+ // menuData.forEach((item, index) => {
|
|
|
+ // if (item["children"]) {
|
|
|
+ // let hasChildrenMenu = item["children"].filter((i) => {
|
|
|
+ // return !i.hidden || i.hidden == false
|
|
|
+ // })
|
|
|
+ // if (hasChildrenMenu == null || hasChildrenMenu.length == 0) {
|
|
|
+ // item["hidden"] = true
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // //console.log(" menu show json ", menuData)
|
|
|
+ // //update--end--autor:qinfeng-----date:20200109------for:JEECG-63 一级菜单的子菜单全部是隐藏路由,则一级菜单不显示------
|
|
|
+ commit('SET_PERMISSIONLIST', menuData)
|
|
|
+ // 设置系统安全模式
|
|
|
+ commit('SET_SYS_SAFE_MODE', response.result.sysSafeMode)
|
|
|
+ } else {
|
|
|
+ reject('getPermissionList: permissions must be a non-null array !')
|
|
|
+ }
|
|
|
+ resolve(response)
|
|
|
+ }).catch(error => {
|
|
|
+ reject(error)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
// 登出
|
|
|
Logout({ commit, state }) {
|