You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
550 B
23 lines
550 B
11 months ago
|
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)
|
||
|
}
|