|
@@ -112,11 +112,19 @@
|
|
|
this.swiperHeight = res.windowWidth / 2
|
|
|
}
|
|
|
})
|
|
|
- // if (!uni.getStorageSync('token')) {
|
|
|
- // uni.reLaunch({
|
|
|
- // url: '/pages/index/login'
|
|
|
- // });
|
|
|
- // }
|
|
|
+ if (!uni.getStorageSync('token')&&!uni.getStorageSync('userData')) {
|
|
|
+ // uni.reLaunch({
|
|
|
+ // url: '/pages/index/login'
|
|
|
+ // });
|
|
|
+ uni.setStorage({
|
|
|
+ key: 'userData',
|
|
|
+ data: {
|
|
|
+ headImage: '',
|
|
|
+ userName: '游客',
|
|
|
+ userId: String((new Date()).getTime() * Math.random()),
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
onShow() {
|
|
|
this.getBaseInfo()
|