Changes view

This commit is contained in:
rsgltzyd 2024-12-09 23:44:29 +08:00
parent e68da9927e
commit 2810c44f8a
2 changed files with 21 additions and 0 deletions

15
src/utils/auth.js Normal file
View File

@ -0,0 +1,15 @@
import Cookies from 'js-cookie'
const TokenKey = 'Admin-Token'
export function getToken() {
return Cookies.get(TokenKey)
}
export function setToken(token) {
Cookies.set(TokenKey, token)
}
export function removeToken() {
Cookies.remove(TokenKey)
}

6
src/utils/errorCode.js Normal file
View File

@ -0,0 +1,6 @@
export default {
401: '认证失败',
403: '没有权限',
404: '资源不存在',
default: '系统未知错误'
}