功能:新增微信小程序界面
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
const STORAGE_KEYS = {
|
||||
ACCESS_TOKEN: 'accessToken',
|
||||
REFRESH_TOKEN: 'refreshToken',
|
||||
USER_INFO: 'userInfo',
|
||||
NEED_SET_PASSWORD: 'needSetPassword'
|
||||
}
|
||||
|
||||
function getStorage(key, defaultValue) {
|
||||
try {
|
||||
const value = wx.getStorageSync(key)
|
||||
return value === '' || value === undefined ? defaultValue : value
|
||||
} catch (error) {
|
||||
return defaultValue
|
||||
}
|
||||
}
|
||||
|
||||
function setStorage(key, value) {
|
||||
wx.setStorageSync(key, value)
|
||||
}
|
||||
|
||||
function removeStorage(key) {
|
||||
wx.removeStorageSync(key)
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
STORAGE_KEYS,
|
||||
getStorage,
|
||||
setStorage,
|
||||
removeStorage
|
||||
}
|
||||
Reference in New Issue
Block a user