<template>
	
</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,'用户信息');
						uni.setStorageSync('worker_role',res.data.role);
						if(res.data.role==2){
							uni.reLaunch({
								url:'/pages/worker/sign/sign?userType=director'
							})
						}else{
							uni.reLaunch({
								url:'/pages/worker/sign/sign?userType=worker'
							})
						}
					}
				})
			},
		}
	}
</script>
<style>
	
</style>