This commit is contained in:
duan
2025-09-29 10:42:48 +08:00
parent 89db955ec1
commit 096f591123
80 changed files with 8735 additions and 3286 deletions

View File

@@ -18,13 +18,13 @@ const appCache = {
const model = {
setLogin(res){
const user=res.user.user
const user=res.shopInfo
uni.setStorageSync('logoutHandle',false)
uni.setStorageSync('shopId', res.shopId)
uni.setStorageSync('shopName',res.shopName)
uni.setStorageSync('logo',res.logo)
uni.setStorageSync('shopId', user.id)
uni.setStorageSync('shopName',user.shopName)
uni.setStorageSync('logo',user.logo)
uni.setStorageSync('loginType',res.loginType)
uni.setStorageSync('shopUserId',user.id)
// uni.setStorageSync('shopUserId',user.id)
if(res.loginType=='staff'){
uni.setStorageSync('merchantName',user.createBy||user.updateBy)
}
@@ -51,14 +51,14 @@ const model = {
if (val) {
// 有值,为放置
appCache.tokenVal = val
uni.setStorageSync(appConfig.tokenKey, val)
appCache.tokenVal = val.tokenValue
uni.setStorageSync(appConfig.tokenKey, val.tokenValue)
} else {
// 否则为获取
if (!appCache.tokenVal) {
//缓存取不到,获取应用本地信息
appCache.tokenVal = uni.getStorageSync(appConfig.tokenKey)
appCache.tokenVal = uni.getStorageSync(appConfig.tokenKey).tokenValue
}
return appCache.tokenVal
}
@@ -72,8 +72,8 @@ const model = {
if (val) {
// 有值,为放置
appCache.shopId = val
uni.setStorageSync('shopId', val)
appCache.shopId = val.id
uni.setStorageSync('shopId', val.id)
} else {
// 否则为获取
@@ -223,20 +223,18 @@ const model = {
if (currentUserInfo) {
// 仅保存基础数据
let saveUser = {
sysUserId: currentUserInfo.sysUserId, // 用户ID
realname: currentUserInfo.realname, // 用户姓名
avatarUrl: currentUserInfo.avatarUrl, // 头像
telphone: currentUserInfo.telphone, // 手机号
userType: currentUserInfo.userType, // 用户类型
mchNo: currentUserInfo.userNo, // 商户No
mchShortName: currentUserInfo.shortName, // 商户简称
mchType: currentUserInfo.mchType, // 商户类型
mchLevel: currentUserInfo.mchLevel, // 商户级别
isHasMemberEnt:currentUserInfo.isHasMemberEnt,// 是否购买会员模块
entIdList: currentUserInfo.entIdList, // 权限集合List
// sysUserId: currentUserInfo.sysUserId, // 用户ID
// realname: currentUserInfo.realname, // 用户姓名
// avatarUrl: currentUserInfo.avatarUrl, // 头像
// telphone: currentUserInfo.telphone, // 手机号
// userType: currentUserInfo.userType, // 用户类型
// mchNo: currentUserInfo.userNo, // 商户No
// mchShortName: currentUserInfo.shortName, // 商户简称
// mchType: currentUserInfo.mchType, // 商户类型
// mchLevel: currentUserInfo.mchLevel, // 商户级别
// isHasMemberEnt:currentUserInfo.isHasMemberEnt,// 是否购买会员模块
// entIdList: currentUserInfo.entIdList, // 权限集合List
...currentUserInfo
}
uni.setStorageSync("currentUserInfo", saveUser) // 改变存储
appCache.currentUser = null