index.vue
1016 Bytes
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<template>
</template>
<script setup>
import {
onShow
} from '@dcloudio/uni-app';
import {
getInfo,
getWebInfo
} from '@/common/login.js';
import {
useUserStore
} from '../../store/modules/user';
const userStore = useUserStore()
const app = getApp()
onShow(() => {
let user = userStore.user
if (!user) {
// uni.reLaunch({
// url: '/login/login'
// })
return
}
let userName = uni.getStorageSync('userName')
console.log('userName', userName)
console.log('app.globalData.userType ', app.globalData.userType )
if (userName) {
if(app.globalData.userType == 4){
uni.reLaunch({
url: '/pages/index/daoGuanPerson'
})
return
}else{
uni.reLaunch({
url: '/pages/index/home'
})
return
}
}
let webUserName = uni.getStorageSync('webUserName')
if (webUserName) {
uni.reLaunch({
url: '/personal/home'
})
return
}
})
</script>
<style scope lang="scss">
</style>