Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5b3dec55
authored
May 30, 2023
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
权限问题修复
1 parent
b700dd6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
20 deletions
src/store/modules/d2admin/modules/account.js
src/store/modules/d2admin/modules/account.js
View file @
5b3dec5
...
@@ -89,40 +89,48 @@ export default {
...
@@ -89,40 +89,48 @@ export default {
getAuths
({}).
then
(
async
(
res
)
=>
{
getAuths
({}).
then
(
async
(
res
)
=>
{
userInfo
.
detail
.
merchantId
=
userInfo
.
detail
.
merchantNo
userInfo
.
detail
.
merchantId
=
userInfo
.
detail
.
merchantNo
var
routeAll
=
util
.
permision
.
flatten
(
Object
.
values
(
localRoutes
))
var
routeAll
=
util
.
permision
.
flatten
(
Object
.
values
(
localRoutes
))
var
indexPage
=
routeAll
.
find
((
item
)
=>
item
.
authId
===
"907"
)
var
indexPage
=
routeAll
.
find
((
item
)
=>
item
.
authId
===
"907"
)
routeAll
.
splice
(
routeAll
.
splice
(
routeAll
.
findIndex
((
item
)
=>
item
.
authId
===
"907"
),
routeAll
.
findIndex
((
item
)
=>
item
.
authId
===
"907"
),
1
1
)
)
routeAll
.
unshift
(
indexPage
)
routeAll
.
unshift
(
indexPage
)
if
(
userInfo
.
detail
.
accountType
!==
7
)
{
!
res
.
map
((
i
)
=>
i
.
authId
).
includes
(
"907"
)
&&
// if (userInfo.detail.accountType !== 7) {
res
.
unshift
({
// !res.map((i) => i.authId).includes("907") &&
authId
:
"907"
,
// res.unshift({
name
:
"总览"
,
// authId: "907",
parentId
:
"1"
// name: "总览",
})
// parentId: "1"
}
// })
// }
var
tempAuths
=
[]
var
tempAuths
=
[]
// 修复超管拿不到权限权限问题
// 修复超管拿不到权限权限问题
var
targetRoutes
=
userInfo
.
beSuper
var
targetRoutes
=
res
.
map
((
i
)
=>
i
.
authId
)
?
routeAll
.
map
((
i
)
=>
i
.
authId
)
// var targetRoutes = userInfo.beSuper
:
res
.
map
((
i
)
=>
i
.
authId
)
// ? routeAll.map((i) => i.authId)
// : res.map((i) => i.authId)
// if (targetRoutes.length === 0) {
// this.$message.warning("无权限,请联系管理员")
// return reject("无权限")
// }
// console.log(res, "res")
// console.log(res, "res")
// console.log(userInfo.beSuper, "userInfo.beSuper")
// console.log(userInfo.beSuper, "userInfo.beSuper")
// console.log(targetRoutes, "targetRoutes")
// console.log(targetRoutes, "targetRoutes")
// 先处理园区店角色是不能拿到 订单审批和发货的页面
// 先处理园区店角色是不能拿到 订单审批和发货的页面
// console.log("userInfo.beYQMerchant", userInfo.beYQMerchant)
// console.log("userInfo.beYQMerchant", userInfo.beYQMerchant)
const
filterList
=
[
"90903"
,
"90904"
]
//
const filterList = ["90903", "90904"]
if
(
!
userInfo
.
beSuper
&&
userInfo
.
beYQMerchant
)
{
//
if (!userInfo.beSuper && userInfo.beYQMerchant) {
targetRoutes
=
targetRoutes
.
filter
((
item
)
=>
{
//
targetRoutes = targetRoutes.filter((item) => {
return
!
filterList
.
includes
(
item
.
toString
())
//
return !filterList.includes(item.toString())
})
//
})
}
//
}
if
(
userInfo
.
beServerMerchant
)
{
//
if (userInfo.beServerMerchant) {
targetRoutes
.
push
(
"90904"
)
//
targetRoutes.push("90904")
}
//
}
// console.log("targetRoutes", targetRoutes)
// console.log("targetRoutes", targetRoutes)
routeAll
routeAll
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment