Template
1
0
mirror of https://github.com/un-pany/v3-admin-vite.git synced 2025-04-23 04:19:20 +08:00
v3-admin-vite/src/config/white-list.ts

16 lines
504 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { type RouteLocationNormalized } from "vue-router"
/** 免登录白名单(匹配路由 path */
const whiteListByPath: string[] = ["/login"]
/** 免登录白名单(匹配路由 name */
const whiteListByName: string[] = []
/** 判断是否在白名单 */
const isWhiteList = (to: RouteLocationNormalized) => {
// path 和 name 任意一个匹配上即可
return whiteListByPath.indexOf(to.path) !== -1 || whiteListByName.indexOf(to.name as any) !== -1
}
export default isWhiteList