首页默认静默登陆
This commit is contained in:
@@ -398,13 +398,20 @@ export default {
|
||||
this.getBannered();
|
||||
} else {
|
||||
this.storeinfo = res.data.data.list.filter((item) => item.is_online == 1)
|
||||
uni.setStorageSync('store_id', this.storeinfo[0].store.id)
|
||||
this.headerTitle = this.storeinfo[0].store['name']
|
||||
// 只在 store_id 不存在时才设置,避免覆盖扫码设置的 store_id
|
||||
if (!uni.getStorageSync('store_id') && this.storeinfo.length > 0) {
|
||||
uni.setStorageSync('store_id', this.storeinfo[0].store.id)
|
||||
}
|
||||
if (this.storeinfo.length > 0) {
|
||||
this.headerTitle = this.storeinfo[0].store['name']
|
||||
}
|
||||
this.getBannered();
|
||||
}
|
||||
} else {
|
||||
// 未登录时不跳转,使用默认store_id=11001
|
||||
uni.setStorageSync('store_id', '11001');
|
||||
// 接口失败时,只在 store_id 不存在时才设置默认值,避免覆盖扫码设置的 store_id
|
||||
if (!uni.getStorageSync('store_id')) {
|
||||
uni.setStorageSync('store_id', '11001');
|
||||
}
|
||||
this.getBannered();
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user