sass警告
This commit is contained in:
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* 从 document.cookie 中提取指定 name 的值
|
||||
*/
|
||||
export function getCookie(name: string): string | null {
|
||||
const match = document.cookie.match(new RegExp(`(?:^|;\\s*)${name}=([^;]*)`))
|
||||
return match ? decodeURIComponent(match[1]) : null
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否已登录 — 通过 Cookie 中是否存在 Token 来判断
|
||||
*/
|
||||
export function isLoggedIn(): boolean {
|
||||
return !!getCookie('Token')
|
||||
}
|
||||
Reference in New Issue
Block a user