feat: 支付商户

This commit is contained in:
luo
2026-09-10 16:50:06 +08:00
parent ef966171b4
commit d3d257cdf8
21 changed files with 2884 additions and 27 deletions

View File

@@ -1,4 +1,4 @@
/**
/**
* 权限验证相关工具函数
*/
@@ -63,8 +63,17 @@ export const hasRoutePermission = (
}
}
// 检查允许访问的用户类型
if (route.meta?.allowedUserTypes) {
const allowedUserTypes = route.meta.allowedUserTypes as number[]
const userType = Number(userInfo.user_type)
if (!allowedUserTypes.includes(userType)) {
return false
}
}
// 如果路由没有设置额外的权限要求,直接通过
if (!route.meta?.roles && !route.meta?.permissions) {
if (!route.meta?.roles && !route.meta?.permissions && !route.meta?.allowedUserTypes) {
return true
}
@@ -195,3 +204,4 @@ export const buildLoginRedirect = (currentPath: string): string => {
}
return `/auth/login?redirect=${encodeURIComponent(currentPath)}`
}