mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 09:41:58 +08:00
23 lines
550 B
JavaScript
23 lines
550 B
JavaScript
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)
|
|
}
|