1.将部门修改为渠道,并且所有dice_表关联渠道表

2.将所有配置表,记录表设置关联渠道
3.优化后台页面设置
This commit is contained in:
2026-05-19 09:49:02 +08:00
parent 085454fb78
commit dd264b1e97
143 changed files with 4741 additions and 1254 deletions

View File

@@ -0,0 +1,48 @@
import type { RouteLocationNormalized } from 'vue-router'
import { useUserStore } from '@/store/modules/user'
/** 页面自带左侧渠道栏,不再包一层全局渠道壳 */
const BUILTIN_CHANNEL_LAYOUT_PATHS = [
'/system/user',
'/system/dept'
]
export function isSuperAdminUser(): boolean {
const userStore = useUserStore()
return Number(userStore.info?.id ?? 0) === 1
}
/** 游戏配置类页面:显示「默认配置模板」 */
export function isConfigChannelRoute(route: Pick<RouteLocationNormalized, 'path' | 'meta'>): boolean {
if (route.meta?.channelScope === 'config') {
return true
}
return /\/(config|ante_config|lottery_pool_config|reward_config|game)(\/|$)/.test(route.path)
}
/** 角色管理左侧渠道树含默认模板dept_id=0与各渠道角色 */
export function isRoleChannelRoute(route: Pick<RouteLocationNormalized, 'path' | 'meta'>): boolean {
if (route.meta?.channelScope === 'role') {
return true
}
return route.path.startsWith('/system/role')
}
export function shouldWrapSuperAdminChannelLayout(route: RouteLocationNormalized): boolean {
if (!isSuperAdminUser()) {
return false
}
if (route.meta?.isFullPage) {
return false
}
if (route.meta?.noChannelLayout === true) {
return false
}
const path = route.path
for (let i = 0; i < BUILTIN_CHANNEL_LAYOUT_PATHS.length; i++) {
if (path.startsWith(BUILTIN_CHANNEL_LAYOUT_PATHS[i])) {
return false
}
}
return true
}