Browse Source

加权限

jiangcheng/feature-20260402142510-现金四期
ZhangYong 1 week ago
parent
commit
6f9037d0a9
  1. 4
      src/router/index.js
  2. 14
      src/utils/menuUtils.js

4
src/router/index.js

@ -542,8 +542,8 @@ router.beforeEach(async (to, from, next) => {
const requiresPermission = to.meta && to.meta.permissionId; const requiresPermission = to.meta && to.meta.permissionId;
if (requiresPermission) { if (requiresPermission) {
const hasPermission = Array.isArray(requiresPermission) const hasPermission = Array.isArray(requiresPermission)
? requiresPermission.some(id => userPermissionIds.includes(id))
: userPermissionIds.includes(requiresPermission);
? requiresPermission.some(id => userPermissionIds.some(uid => String(uid) === String(id)))
: userPermissionIds.some(uid => String(uid) === String(requiresPermission));
if (!hasPermission) { if (!hasPermission) {
next('/noPermission'); next('/noPermission');

14
src/utils/menuUtils.js

@ -86,7 +86,19 @@ export const getRoutePath = (menu) => {
"149": "/moneyManage/financialAccount/performanceAttribution", // 业绩归属账(财务核算子菜单) "149": "/moneyManage/financialAccount/performanceAttribution", // 业绩归属账(财务核算子菜单)
"125": "/channelManage/reward", // 打赏管理(频道管理子菜单) "125": "/channelManage/reward", // 打赏管理(频道管理子菜单)
"126": "/channelManage/fans", // 铁粉管理(频道管理子菜单) "126": "/channelManage/fans", // 铁粉管理(频道管理子菜单)
"127": "/channelManage/cart" // 小黄车管理(频道管理子菜单)
"127": "/channelManage/cart", // 小黄车管理(频道管理子菜单)
"150": "/walletManage", // 钱包管理
"151": "/walletManage/walletBalance", // 钱包余额
"152": "/walletManage/walletDetail", // 钱包明细
"153": "/walletManage/walletDetail/hkWallet", // 香港钱包
"154": "/walletManage/walletDetail/sgWalletHC", // 新加坡HC钱包
"155": "/walletManage/walletDetail/sgWalletCM", // 新加坡CM钱包
"156": "/walletManage/walletDetail/myWallet", // 马来西亚钱包
"157": "/walletManage/walletDetail/caWallet", // 加拿大钱包
"158": "/walletManage/walletDetail/thWalletHS", // 泰国HS钱包
"159": "/walletManage/walletDetail/thWalletHA", // 泰国HA钱包
"160": "/walletManage/walletDetail/vnWallet", // 越南钱包
"161": "/walletManage/walletDetail/bjWallet" // 北京钱包
}; };
// 从映射表中匹配路由,无匹配时返回无权限页面路径 // 从映射表中匹配路由,无匹配时返回无权限页面路径

Loading…
Cancel
Save