Commit b03791a6 authored by 程卓's avatar 程卓

去除mixin多余的oldsys

parent 1e7f274a
......@@ -48,7 +48,7 @@ async function GetRoutes(router) {
break
default: // 当前仅可使用pudong / xuhui-sit/uat进行打包
MicRouters = yangpu
MicRouters = xuhui
break
}
......
......@@ -5,6 +5,8 @@ let BASE_URL = '', MOCK_URL='',
* 1、此处配置当前项目在不同环境下的API请求前缀
* 2、前端服务间、后端服务间需做跨域处理
*/
// console.log(window.location)
console.log(window.location)
switch (process.env.NODE_ENV) {
case 'devol': // 本地线上部署环境下
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
......@@ -63,8 +65,8 @@ case 'huangpu-prod':
default: // 默认环境下(开发环境)
// BASE_URL = 'http://31.0.161.39/apiv2'
// BASE_URL = 'http://211.136.105.193/apiv2'
BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
// BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://yangpu-hm.omniview.pro/api/v2'
BASE_URL = 'http://xuhui.hm.omniview.pro/api/v2'
// BASE_URL = 'http://pudong.hm.omniview.pro/api/v2'
// BASE_URL = 'http://211.136.105.193/apiv2'
MOCK_URL = 'https://yapi.omniview.pro/mock/283'
......
......@@ -15,22 +15,20 @@ export const permission = {
url: this.$api.GET_REDIS.replace('{id}', '?message='+ res.data.content.id),
}).then(res => {
if (res.code == '200') {
console.log(1)
// console.log(1)
}
})
// 本地存储用户基本信息
let userInfo = res.data.content, name, oldSysAuthCode, isAllPerm = false
let userInfo = res.data.content, name, isAllPerm = false
if(!res.data || !res.data.content){
userInfo = {}
name = ''
oldSysAuthCode = []
}else{
userInfo = res.data.content
name = userInfo.username = res.data.content.name||res.data.content.phone
this.$store.commit('SET_USERINFO', userInfo)
this.$cookie.set('userName', name)
this.$store.commit('SET_USERNAME', name)
oldSysAuthCode = getOldSysAuthCode(userInfo.sysDicSet)
// 获取用户是否为超级管理权限
isAllPerm = userInfo.isAllPerm?userInfo.isAllPerm:false
}
......@@ -44,9 +42,7 @@ export const permission = {
}).then(res => {
// 当前用户全部权限编码,包含菜单及功能操作
if(res.data!=undefined && res.data!=null && res.data.content!=undefined && res.data.content!=null){
authCodeList = res.data.content.concat(oldSysAuthCode)
}else{
authCodeList = oldSysAuthCode
authCodeList = res.data.content
}
// 写入vuex
this.$store.commit('SET_MENU', {authMenuAll, authCodeList, isAllPerm})
......@@ -89,14 +85,9 @@ export const permission = {
params: {}
}).then(res => {
// 当前用户全部权限编码,包含菜单及功能操作
const oldSysDatas = !this.$store.state.userInfos ? []: this.$store.state.userInfos.sysDicSet
let authCodeList = []
const oldSysAuthCode = getOldSysAuthCode(oldSysDatas)
if(res.data!=undefined && res.data!=null && res.data.content!=undefined && res.data.content!=null){
authCodeList = res.data.content.concat(oldSysAuthCode)
}else{
authCodeList = oldSysAuthCode
authCodeList = res.data.content
}
authMenuAll = getSideMenu(routes, authCodeList)
this.$store.commit('SET_MENU', {authMenuAll, authCodeList, isAllPerm})
......@@ -135,16 +126,6 @@ export {
checkHideInBread
}
function getOldSysAuthCode(syslist){
const oldSysAuthCode = []
if(syslist == undefined || syslist == null || 'object' != typeof syslist) return oldSysAuthCode
for(let i=0;i<syslist.length;i++){
oldSysAuthCode.push(syslist[i].sysCode)
}
return oldSysAuthCode
}
/**
* 递归遍历所有router,找到某一个router节点
* @param {Array} allRouter 某一层级的route节点,必传
......
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