You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
<template>
|
|
|
|
<view class="content">
|
|
|
|
|
|
|
|
|
|
|
|
</view>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
|
|
|
|
};
|
|
|
|
},
|
|
|
|
onShow() {
|
|
|
|
console.log('onShow', getApp().globalData.isLogin)
|
|
|
|
|
|
|
|
let token = uni.getStorageSync("Global-Auth-Token")
|
|
|
|
if (token != null && token.length != 0) {
|
|
|
|
getApp().globalData.token = token
|
|
|
|
}
|
|
|
|
let isLogin =uni.getStorageSync("isLogin")
|
|
|
|
if (isLogin != null && isLogin == 1) {
|
|
|
|
getApp().globalData.isLogin = isLogin
|
|
|
|
}
|
|
|
|
let sid = uni.getStorageSync("sid")
|
|
|
|
if (sid != null && sid.length != 0) {
|
|
|
|
getApp().globalData.sid = sid
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('用户Sid', getApp().globalData.sid)
|
|
|
|
console.log('token', getApp().globalData.token)
|
|
|
|
console.log('是否登陆', getApp().globalData.isLogin)
|
|
|
|
|
|
|
|
// setTimeout(() => {
|
|
|
|
if (getApp().globalData.isLogin) {
|
|
|
|
var userSid = getApp().globalData.sid
|
|
|
|
console.log(">>>>>", userSid)
|
|
|
|
// this.getData(userSid, true)
|
|
|
|
// uni.setTabBarBadge({ //显示数字
|
|
|
|
// index: 0, //tabbar下标
|
|
|
|
// text: '100' //数字
|
|
|
|
// })
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* #ifdef MP-WEIXIN */
|
|
|
|
this.WxSilentLogin()
|
|
|
|
/* #endif */
|
|
|
|
|
|
|
|
/* #ifdef APP-PLUS */
|
|
|
|
uni.redirectTo({
|
|
|
|
url: '../login/login'
|
|
|
|
})
|
|
|
|
/* #endif */
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
|
|
|
</style>
|