Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wbx-PCAndMobi
pc
Commits
b03791a6
Commit
b03791a6
authored
May 07, 2021
by
程卓
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
去除mixin多余的oldsys
parent
1e7f274a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
26 deletions
+9
-26
getMicRouters.js
src/router/getMicRouters.js
+1
-1
api.js
src/server/api.js
+4
-2
mixins.js
src/util/mixins.js
+4
-23
No files found.
src/router/getMicRouters.js
View file @
b03791a6
...
...
@@ -48,7 +48,7 @@ async function GetRoutes(router) {
break
default
:
// 当前仅可使用pudong / xuhui-sit/uat进行打包
MicRouters
=
yangpu
MicRouters
=
xuhui
break
}
...
...
src/server/api.js
View file @
b03791a6
...
...
@@ -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'
...
...
src/util/mixins.js
View file @
b03791a6
...
...
@@ -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节点,必传
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment