Commit b03791a6 authored by 程卓's avatar 程卓

去除mixin多余的oldsys

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