增加店铺员工id
This commit is contained in:
parent
1f499a3bd6
commit
b5eb099c75
|
|
@ -23,6 +23,7 @@ const model = {
|
|||
uni.setStorageSync('shopName',res.shopName)
|
||||
uni.setStorageSync('logo',res.logo)
|
||||
uni.setStorageSync('loginType',res.loginType)
|
||||
uni.setStorageSync('shopUserId',res.user.user.id)
|
||||
},
|
||||
// 退出清空所有的缓存数据。 (不包含 环境相关)
|
||||
cleanByLogout: () => {
|
||||
|
|
@ -79,6 +80,27 @@ const model = {
|
|||
return appCache.shopId
|
||||
}
|
||||
},
|
||||
// 获取和放置店铺员工id
|
||||
shopUserId: (val, isDelete = false) => {
|
||||
if (isDelete) {
|
||||
appCache.shopUserId = ""
|
||||
return uni.removeStorageSync('shopUserId')
|
||||
}
|
||||
|
||||
if (val) {
|
||||
// 有值,为放置
|
||||
appCache.shopUserId = val
|
||||
uni.setStorageSync('shopUserId', val)
|
||||
} else {
|
||||
// 否则为获取
|
||||
|
||||
if (!appCache.shopUserId) {
|
||||
//缓存取不到,获取应用本地信息
|
||||
appCache.shopUserId = uni.getStorageSync('shopUserId')
|
||||
}
|
||||
return appCache.shopUserId
|
||||
}
|
||||
},
|
||||
// 获取和放置useType就餐类型
|
||||
useType: (val, isDelete = false) => {
|
||||
if (isDelete) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue