building-sign/pages/pagehome/pagehome.vue

40 lines
644 B
Vue
Raw Normal View History

2022-11-15 10:03:13 +00:00
<template>
<view>
</view>
</template>
<script>
export default {
data() {
return {
}
},
2023-01-14 03:15:59 +00:00
onShow() {
2023-01-14 04:28:31 +00:00
// 获取用户信息
this.getUserInfo();
2022-11-15 10:03:13 +00:00
},
2023-01-14 03:15:59 +00:00
methods: {
2023-01-14 04:28:31 +00:00
// 获取用户信息
getUserInfo(){
this.$requst.post('/api/v1/user/info').then(res=>{
if(res.code==0){
console.log(res,'用户信息');
if(res.data.role==2){
uni.reLaunch({
url:'/pages/worker/sign/sign?userType=director'
})
}else{
uni.reLaunch({
url:'/pages/worker/sign/sign?userType=worker'
})
}
}
})
},
2022-11-15 10:03:13 +00:00
}
}
</script>
<style>
</style>