building-sign/pages/pagehome/pagehome.vue

39 lines
683 B
Vue
Raw Normal View History

2023-01-16 07:10:35 +00:00
<template>
2022-11-15 10:03:13 +00:00
</template>
<script>
export default {
data() {
return {
}
},
2023-01-16 07:10:35 +00:00
onLoad() {
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,'用户信息');
2023-01-14 08:13:24 +00:00
uni.setStorageSync('worker_role',res.data.role);
2023-01-14 04:28:31 +00:00
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>