mirror of
https://gitee.com/hhyykk/ipms-sjy.git
synced 2025-07-07 15:45:08 +08:00
初始化管理后台的 uniapp 版本
This commit is contained in:
22
yudao-ui-admin-uniapp/utils/auth.js
Normal file
22
yudao-ui-admin-uniapp/utils/auth.js
Normal file
@ -0,0 +1,22 @@
|
||||
const AccessTokenKey = 'ACCESS_TOKEN'
|
||||
const RefreshTokenKey = 'REFRESH_TOKEN'
|
||||
|
||||
// ========== Token 相关 ==========
|
||||
|
||||
export function getAccessToken() {
|
||||
return uni.getStorageSync(AccessTokenKey)
|
||||
}
|
||||
|
||||
export function getRefreshToken() {
|
||||
return uni.getStorageSync(RefreshTokenKey)
|
||||
}
|
||||
|
||||
export function setToken(token) {
|
||||
uni.setStorageSync(AccessTokenKey, token.accessToken)
|
||||
uni.setStorageSync(RefreshTokenKey, token.refreshToken)
|
||||
}
|
||||
|
||||
export function removeToken() {
|
||||
uni.removeStorageSync(AccessTokenKey)
|
||||
uni.removeStorageSync(RefreshTokenKey)
|
||||
}
|
Reference in New Issue
Block a user