添加配置项,首页
This commit is contained in:
16
utils/storage.js
Normal file
16
utils/storage.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { STORAGE_KEYS } from '@/constants/storageKeys'
|
||||
|
||||
/** 保存 token */
|
||||
export const setToken = (v) => {
|
||||
return uni.setStorageSync(STORAGE_KEYS.TOKEN, v)
|
||||
}
|
||||
|
||||
/** 获取 token */
|
||||
export const getToken = () => {
|
||||
return uni.getStorageSync(STORAGE_KEYS.TOKEN) || ''
|
||||
}
|
||||
|
||||
/** 清楚 token */
|
||||
export const removeToken = () => {
|
||||
return uni.removeStorageSync(STORAGE_KEYS.TOKEN)
|
||||
}
|
||||
Reference in New Issue
Block a user