统一甲屿云命名体系
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
const API_AUTH_FREE_PATHS = [
|
||||
'/user/send-verification-code',
|
||||
'/user/phone-login',
|
||||
'/user/check/login-shops/phone/',
|
||||
'/legal-agreement/current'
|
||||
]
|
||||
|
||||
const ADMIN_AUTH_FREE_PATHS = [
|
||||
'/auth/login',
|
||||
'/auth/login-shops/',
|
||||
'/auth/refresh'
|
||||
]
|
||||
|
||||
const matchPath = (url: string | undefined, paths: string[]): boolean => {
|
||||
const target = String(url || '')
|
||||
return paths.some(path => target === path || target.startsWith(path))
|
||||
}
|
||||
|
||||
export const isApiAuthFreePath = (url: string | undefined): boolean => matchPath(url, API_AUTH_FREE_PATHS)
|
||||
|
||||
export const isAdminAuthFreePath = (url: string | undefined): boolean => matchPath(url, ADMIN_AUTH_FREE_PATHS)
|
||||
Reference in New Issue
Block a user