feat: 支付商户
This commit is contained in:
@@ -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)}`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user