htc 1 周之前
父节点
当前提交
694a1836ef
共有 1 个文件被更改,包括 13 次插入0 次删除
  1. 13 0
      pages/login/wxLogin.vue

+ 13 - 0
pages/login/wxLogin.vue

@@ -21,6 +21,19 @@
 				imgBase:this.$imgBase
 			}
 		},
+		onReady() {
+			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
+			}
+		},
 		methods:{
 			decryptPhoneNumber(e){
 				if(uni.getStorageSync('token')){