building-sign/pages/pagehome/pagehome.vue

44 lines
715 B
Vue
Raw Normal View History

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