功能:新增微信小程序一键登录
This commit is contained in:
@@ -16,6 +16,10 @@ function getNeedSetPassword() {
|
||||
return Boolean(getStorage(STORAGE_KEYS.NEED_SET_PASSWORD, false))
|
||||
}
|
||||
|
||||
function getPreferredMiniLoginShopId() {
|
||||
return getStorage(STORAGE_KEYS.PREFERRED_MINI_LOGIN_SHOP_ID, '')
|
||||
}
|
||||
|
||||
function isLoggedIn() {
|
||||
return Boolean(getAccessToken())
|
||||
}
|
||||
@@ -64,14 +68,25 @@ function clearSession() {
|
||||
removeStorage(STORAGE_KEYS.NEED_SET_PASSWORD)
|
||||
}
|
||||
|
||||
function setPreferredMiniLoginShopId(shopId) {
|
||||
if (shopId === undefined || shopId === null || shopId === '') {
|
||||
removeStorage(STORAGE_KEYS.PREFERRED_MINI_LOGIN_SHOP_ID)
|
||||
return
|
||||
}
|
||||
|
||||
setStorage(STORAGE_KEYS.PREFERRED_MINI_LOGIN_SHOP_ID, String(shopId))
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
getAccessToken,
|
||||
getRefreshToken,
|
||||
getStoredUserInfo,
|
||||
getNeedSetPassword,
|
||||
getPreferredMiniLoginShopId,
|
||||
isLoggedIn,
|
||||
setSession,
|
||||
updateStoredUserInfo,
|
||||
setNeedSetPassword,
|
||||
setPreferredMiniLoginShopId,
|
||||
clearSession
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user