Commit 5b3dec55 by 张立顺

权限问题修复

1 parent b700dd6f
......@@ -89,40 +89,48 @@ export default {
getAuths({}).then(async (res) => {
userInfo.detail.merchantId = userInfo.detail.merchantNo
var routeAll = util.permision.flatten(Object.values(localRoutes))
var indexPage = routeAll.find((item) => item.authId === "907")
routeAll.splice(
routeAll.findIndex((item) => item.authId === "907"),
1
)
routeAll.unshift(indexPage)
if (userInfo.detail.accountType !== 7) {
!res.map((i) => i.authId).includes("907") &&
res.unshift({
authId: "907",
name: "总览",
parentId: "1"
})
}
// if (userInfo.detail.accountType !== 7) {
// !res.map((i) => i.authId).includes("907") &&
// res.unshift({
// authId: "907",
// name: "总览",
// parentId: "1"
// })
// }
var tempAuths = []
// 修复超管拿不到权限权限问题
var targetRoutes = userInfo.beSuper
? routeAll.map((i) => i.authId)
: res.map((i) => i.authId)
var targetRoutes = res.map((i) => i.authId)
// var targetRoutes = userInfo.beSuper
// ? 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(userInfo.beSuper, "userInfo.beSuper")
// console.log(targetRoutes, "targetRoutes")
// 先处理园区店角色是不能拿到 订单审批和发货的页面
// console.log("userInfo.beYQMerchant", userInfo.beYQMerchant)
const filterList = ["90903", "90904"]
if (!userInfo.beSuper && userInfo.beYQMerchant) {
targetRoutes = targetRoutes.filter((item) => {
return !filterList.includes(item.toString())
})
}
if (userInfo.beServerMerchant) {
targetRoutes.push("90904")
}
// const filterList = ["90903", "90904"]
// if (!userInfo.beSuper && userInfo.beYQMerchant) {
// targetRoutes = targetRoutes.filter((item) => {
// return !filterList.includes(item.toString())
// })
// }
// if (userInfo.beServerMerchant) {
// targetRoutes.push("90904")
// }
// console.log("targetRoutes", targetRoutes)
routeAll
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!