1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<script>
export default {
onLaunch: function () {
let Authorization = uni.getStorageSync('Authorization')
if (!Authorization || Authorization == '') {
if (
this.$route.path != '/pages/register/register' &&
this.$route.path != '/pages/activityShare/index' &&
this.$route.path != '/pages/register/shareRegister' &&
this.$route.path != '/pages/register/downloadTips' &&
this.$route.path != '/pages/deletion/login'
) {
uni.redirectTo({
url: './pages/login/login'
})
}
}
if (Authorization && !this.$store.state.userInfo) {
this.$store.dispatch('updateUserInfo')
}
//#ifdef APP-PLUS
plus.runtime.getProperty(plus.runtime.appid, function (wgtinfo) {
// 获取 app的version
let appversion = wgtinfo.version
let versionCode = wgtinfo.versionCode
// 存缓存 版本号
try {
uni.setStorageSync('appversion', appversion)
uni.setStorageSync('versionCode', versionCode)
} catch (e) {}
console.log('appversion:' + appversion)
})
//#endif
},
onShow: function () {},
onHide: function () {}
}
</script>
<style>
@import url(@/static/css/main.css);
</style>