fix: 商家订单权限与后端一致(002ac/002ab/003aa)

This commit is contained in:
XingQue
2026-07-06 19:25:15 +08:00
parent 0c08243a37
commit ab91d9a363
2 changed files with 9 additions and 4 deletions

View File

@@ -3,7 +3,7 @@ const CLUB_SCOPE_KEY = 'admin_club_scope';
const CLUB_CONTEXT_KEY = 'admin_club_context';
const MENU_ACCESS_KEY = 'kefu_menu_access';
const MENU_SESSION_KEY = 'kefu_menu_session_v';
const MENU_SESSION_VERSION = '22';
const MENU_SESSION_VERSION = '23';
const DEFAULT_CLUB_ID = 'xq';
let menuAccessInflight = null;
@@ -129,7 +129,7 @@ const KEFU_MENU_ROWS = [
{ page_id: 'assessment.config', parent_id: 'assessment', path: '/assessment/config', sort_order: 22, perm_codes: ['kaohepeizhi'] },
{ page_id: 'assessment.record', parent_id: 'assessment', path: '/assessment/record', sort_order: 23, perm_codes: ['kaohepeizhi'] },
{ page_id: 'order.platform', parent_id: 'order', path: '/order/platform', sort_order: 31, perm_codes: ['002ab'] },
{ page_id: 'order.merchant', parent_id: 'order', path: '/order/merchant', sort_order: 32, perm_codes: ['002ac'] },
{ page_id: 'order.merchant', parent_id: 'order', path: '/order/merchant', sort_order: 32, perm_codes: ['002ac', '002ab', '003aa'] },
{ page_id: 'cross-platform.order', parent_id: 'cross-platform', path: '/cross-order', sort_order: 41, perm_codes: ['003aa'] },
{ page_id: 'cross-platform.settings', parent_id: 'cross-platform', path: '/cross-settings', sort_order: 42, perm_codes: ['003aa'] },
{ page_id: 'cross-platform.data', parent_id: 'cross-platform', path: '/cross-data', sort_order: 43, perm_codes: ['003aa'] },
@@ -210,6 +210,10 @@ export function hasPermCode(access, ...codes) {
return codes.some((c) => list.includes(c));
}
export function hasMerchantOrderPerm(access) {
return hasPermCode(access, '002ac', '002ab', '003aa');
}
export function canShowMenuPage(pageId) {
const access = getMenuAccess();
if (!access) return false;
@@ -340,6 +344,7 @@ export const JITUAN_API = {
kefuLogin: '/jituan/auth/kefu-login',
meContext: '/jituan/auth/me-context',
menuAccess: '/jituan/auth/menu-access',
permDebug: '/jituan/auth/perm-debug',
clubList: '/jituan/club/list',
caiwu: '/jituan/houtai/caiwu',
szxx: '/jituan/houtai/szxx',

View File

@@ -143,7 +143,7 @@ import { ElMessage } from 'element-plus'
import { Refresh } from '@element-plus/icons-vue'
import request from '@/utils/request'
import ClubScopeHint from '@/components/ClubScopeHint.vue'
import { getMenuAccess, hasPermCode } from '@/utils/club-context'
import { getMenuAccess, hasMerchantOrderPerm } from '@/utils/club-context'
const route = useRoute()
const router = useRouter()
@@ -364,7 +364,7 @@ const getStatusType = (code) => {
watch(() => route.query, () => { restoreFromQuery(); fetchOrders() }, { deep: true })
onMounted(() => {
hasPermission.value = hasPermCode(getMenuAccess(), '002ac')
hasPermission.value = hasMerchantOrderPerm(getMenuAccess())
if (!hasPermission.value) return
restoreFromQuery()
fetchOrderTypes()