|
@@ -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')){
|