aslan-h5/src/config/security.js
2026-05-22 16:42:59 +08:00

62 lines
1.3 KiB
JavaScript

export const PUBLIC_PATHS = Object.freeze([
'/',
'/loading',
'/about',
'/apply',
'/not_app',
'/map',
'/404',
'/error',
'/top-list',
'/weekly-star',
'/ranking',
'/games-king',
'/couple',
'/cp-reward',
'/invitation-to-register',
'/invitation/invite-new-user',
'/recharge-reward',
'/login-reward',
'/activities/poker-ace',
'/daily-recharge',
'/activities/gulben-festival',
'/activities/lucky-dollars-season5',
'/activities/lucky-dollars-season4',
'/activities/lesser-bairam',
'/activities/lucky-dollars-season3',
'/activities/spring-festival',
'/recharge',
'/recharge-pay-way',
'/recharge-guide',
'/recharge-agency-recruit',
'/pay-result',
'/search-payee',
'/cash-withdraw',
'/cash-out',
'/cash-out-details',
'/KYC',
'/bank-card',
'/good-ID',
])
export function normalizePath(path = '') {
const normalizedPath = String(path || '/')
.split('?')[0]
.trim()
if (!normalizedPath) {
return '/'
}
return normalizedPath.startsWith('/') ? normalizedPath : `/${normalizedPath}`
}
export function isPublicPath(path = '') {
return PUBLIC_PATHS.includes(normalizePath(path))
}
export function getCurrentHashPath() {
const hashPath = window.location.hash.replace(/^#/, '')
return normalizePath(hashPath || '/')
}