From fdd50ab48c6abe13b21ae55ca344f9c0d7641629 Mon Sep 17 00:00:00 2001 From: lihui Date: Tue, 4 Nov 2025 18:48:29 +0800 Subject: [PATCH] =?UTF-8?q?add=EF=BC=9A=E4=BF=AE=E6=94=B9=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E6=98=A0=E5=B0=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 8 ++++---- src/router/index.js | 1 + src/utils/menuUtils.js | 27 +++++++++++++++------------ src/views/login.vue | 2 ++ src/views/refund/gold/addCoinRefund.vue | 2 +- src/views/refund/gold/coinRefund.vue | 4 ++-- src/views/refund/gold/coinRefundDetail.vue | 4 ++-- 7 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.env.development b/.env.development index 0f38e29..8fa72ce 100644 --- a/.env.development +++ b/.env.development @@ -8,13 +8,13 @@ VITE_UPLOAD_URL=http://39.101.133.168:8828/hljw/api/aws/upload # sunjiabei # VITE_API_BASE='http://192.168.9.28:8081/' # VITE_API_BASE='http://192.168.5.92:8081/' -# zhangyong +# 张勇 # VITE_API_BASE='http://192.168.3.83:8081/' # 本地 # VITE_API_BASE='http://localhost:8081/' -# sunjiabei -# VITE_API_BASE='http://192.168.1.70:8081/' +# 孙加倍 +# VITE_API_BASE='http://192.168.40.12:8081' -# lijianlin +# Lijianlin # VITE_API_BASE='http://192.168.9.41:8081/' # VITE_API_BASE='http://localhost:8081/' diff --git a/src/router/index.js b/src/router/index.js index f68860e..4221c65 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -141,6 +141,7 @@ const routes = [ component: () => import("../views/managerecharge/rate.vue"), meta: { permissionId: [27,28,29] } }, + // 金币充值 { path: '/coinRecharge', diff --git a/src/utils/menuUtils.js b/src/utils/menuUtils.js index c417811..b148ad5 100644 --- a/src/utils/menuUtils.js +++ b/src/utils/menuUtils.js @@ -2,7 +2,7 @@ export function filterMenu(menuList) { return menuList // 过滤不是4级的 123 为菜单 - .filter(menu => menu.menuType !== 4) + .filter(menu => menu.menuType ===1 || menu.menuType === 2 || menu.menuType === 3) .map(menu => ({ ...menu, children: menu.children ? filterMenu(menu.children) : [] @@ -26,7 +26,7 @@ export function findFirstThirdLevelMenu(menuList) { for (const menu of menuList) { // 先检查当前菜单是否为三级菜单 - if (menu.menuType === 3) { + if (menu.menuType === 1) { return menu; } // 若不是,递归查找其子菜单(无论当前菜单是几级,都深入子菜单找三级) @@ -43,14 +43,15 @@ export const getRoutePath = (menu) => { // 路由映射表:key为接口menuName,value为对应路由路径 const routeMap = { - '工作台查看': '/workbench', + '工作台': '/workbench', + '金币管理': '/goldManage', '现金管理': '/moneyManage', '金币审核': '/audit', '金豆审核': '/beanAudit', - '现金汇率': '/rate', + '汇率管理': '/rate', '金币充值': '/coinRecharge', @@ -60,12 +61,12 @@ export const getRoutePath = (menu) => { '金豆消耗': '/beanConsume', - '金币退款': '/coinRefund', + '退款管理': '/coinRefund', // '金豆退款': '/beanRefund', '历史数据查询': '/history', - '金币查询(新)': '/history/newHistory', - '金币查询(旧)': '/history/oldHistory', + '新版金币查询': '/history/newHistory', + '旧版金币查询': '/history/oldHistory', '权限管理': '/permissions', @@ -76,19 +77,21 @@ export const getRoutePath = (menu) => { '金币客户账户明细': '/usergold', '金豆客户账户明细': '/userbean', - '用户管理': '/permissions/userPermission', - '角色管理': '/permissions/rolePermission', + // '用户管理': '/permissions/userPermission', + // '角色管理': '/permissions/rolePermission', '收款明细': '/moneyManage/receiveDetail', '收款-地区客服':'/moneyManage/receiveDetail/receiveService', - '收款-地区财务/负责人':'/moneyManage/receiveDetail/receiveArea', - '收款-总部财务/管理员':'/moneyManage/receiveDetail/receiveHead', + '收款-地区财务':'/moneyManage/receiveDetail/receiveArea', + '收款-地区负责人':'/moneyManage/receiveDetail/receiveArea', + '收款-总部财务':'/moneyManage/receiveDetail/receiveHead', + '退款明细': '/moneyManage/refundDetail', '退款-地区客服':'/moneyManage/refundDetail/refundService', '退款-地区财务':'/moneyManage/refundDetail/refundFinance', '退款-地区负责人':'/moneyManage/refundDetail/refundCharge', - '退款-总部财务/管理员':'/moneyManage/refundDetail/refundHeader', + '退款-总部财务':'/moneyManage/refundDetail/refundHeader', '执行明细': '/moneyManage/executor', }; diff --git a/src/views/login.vue b/src/views/login.vue index 04fd1c2..d8d53e6 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -76,10 +76,12 @@ const login = async function () { console.log('过滤后的菜单树', filteredMenu) // 获取第一个可访问的菜单 const firstMenu = findFirstThirdLevelMenu(filteredMenu) + console.log('获取到的第一个可访问的菜单', firstMenu) // 获取第一个可访问的菜单的 path const redirectPath = firstMenu ? getRoutePath(firstMenu) : '/noPermission' + console.log('跳转的路径', redirectPath) // 跳转 router.push(redirectPath) diff --git a/src/views/refund/gold/addCoinRefund.vue b/src/views/refund/gold/addCoinRefund.vue index 918e0ec..28806fb 100644 --- a/src/views/refund/gold/addCoinRefund.vue +++ b/src/views/refund/gold/addCoinRefund.vue @@ -112,7 +112,7 @@ const getRefund = async function () { // 这是添加退款信息的接口 const add = async function () { // 检查是否有添加权限 - if (!findMenuById(menuTree.value, permissionMapping.addCoinRefund)) { + if (!findMenuById(menuTree.value, permissionMapping.add_gold_coin_refund)) { ElMessage.error('无此权限') return } diff --git a/src/views/refund/gold/coinRefund.vue b/src/views/refund/gold/coinRefund.vue index aad4b2b..ae536a2 100644 --- a/src/views/refund/gold/coinRefund.vue +++ b/src/views/refund/gold/coinRefund.vue @@ -53,8 +53,8 @@ const navigateTo = (name) => { const initPermissions = () => { if (!menuTree.value || !menuTree.value.length) return; - hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.addCoinRefund); - hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.coinRefundDetail); + hasAdd.value = hasMenuPermission(menuTree.value, permissionMapping.add_gold_coin_refund); + hasDetail.value = hasMenuPermission(menuTree.value, permissionMapping.gold_coin_refund_details); }; // 默认跳转逻辑 diff --git a/src/views/refund/gold/coinRefundDetail.vue b/src/views/refund/gold/coinRefundDetail.vue index 40bc164..156241d 100644 --- a/src/views/refund/gold/coinRefundDetail.vue +++ b/src/views/refund/gold/coinRefundDetail.vue @@ -14,7 +14,7 @@ import dayjs from "dayjs"; const adminStore = useAdminStore(); const { adminData, menuTree } = storeToRefs(adminStore); const showEmployeeData = ref(false) -const canLook = findMenuById(menuTree.value, permissionMapping.coinRefundDetail) +const canLook = findMenuById(menuTree.value, permissionMapping.gold_coin_refund_details) const defaultTime = [ new Date(2000, 1, 1, 0, 0, 0), @@ -114,7 +114,7 @@ const getRefundTypes = async function () { // 搜索============================================================== // 搜索方法 const getSelectBy = async function (val) { - if (!findMenuById(menuTree.value, permissionMapping.coinRefundDetail)) { + if (!findMenuById(menuTree.value, permissionMapping.gold_coin_refund_details)) { ElMessage.error('无此权限') return }