增加部分样式,公共方法,增加保存员工登录保存商户号
This commit is contained in:
@@ -18,24 +18,26 @@ const appCache = {
|
||||
const model = {
|
||||
|
||||
setLogin(res){
|
||||
const user=res.user.user
|
||||
uni.setStorageSync('logoutHandle',false)
|
||||
uni.setStorageSync('shopId', res.shopId)
|
||||
uni.setStorageSync('shopName',res.shopName)
|
||||
uni.setStorageSync('logo',res.logo)
|
||||
uni.setStorageSync('loginType',res.loginType)
|
||||
uni.setStorageSync('shopUserId',res.user.user.id)
|
||||
uni.setStorageSync('shopUserId',user.id)
|
||||
if(res.loginType=='staff'){
|
||||
uni.setStorageSync('merchantName',user.createBy||user.updateBy)
|
||||
}
|
||||
},
|
||||
// 退出清空所有的缓存数据。 (不包含 环境相关)
|
||||
cleanByLogout: () => {
|
||||
|
||||
// 1. 清空app级别缓存。
|
||||
Object.keys(appCache).forEach(k => appCache[k] = null)
|
||||
|
||||
const merchantName=uni.getStorageSync('merchantName')
|
||||
let envName = model.env() // 获取到当前的环境变量
|
||||
uni.clearStorageSync() // 清除所有的缓存信息
|
||||
uni.setStorageSync('merchantName',merchantName)
|
||||
model.env(envName) // 重置env
|
||||
|
||||
|
||||
},
|
||||
|
||||
// 获取和放置token
|
||||
|
||||
Reference in New Issue
Block a user