<template>
	<view class="launch-container"></view>
</template>

<script>
	export default {
		data(){
			return {
				
			}
		},
		onLoad() {
			if(uni.getStorageSync('token')){
				let url = '';
				let roleCodes = JSON.parse(uni.getStorageSync('userInfo'))?.roleCodes;
				if(roleCodes.length==0&&JSON.parse(uni.getStorageSync('userInfo'))?.status==2) return this.$showToast('当前员工已离职');
				if(roleCodes.length==0||!roleCodes) url = '/pagesClockin/index';
				else if(roleCodes.includes('Maintenance')||roleCodes.includes('Inspection')) url = '/pages/operation/index';
				else if(roleCodes.includes('inventory')||roleCodes.includes('Admin')||roleCodes.includes('Warehouse Manager')) url = '/pagesStorage/home';
				if(!url) return this.$showToast('无菜单角色，请后台查看!')
				uni.reLaunch({ url })
				return
			}else{
				uni.reLaunch({ url:'/pages/login/wxLogin' })
			}
		},
		methods:{
			
		}
	}
</script>

<style scoped lang="less">
	.launch-container {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100vh;
		width: 100vw;
		background-color: #FFFFFF; 
	}
</style>