فهرست منبع

优化:增加空白启动页

htc 1 روز پیش
والد
کامیت
54d584e062
3فایلهای تغییر یافته به همراه51 افزوده شده و 13 حذف شده
  1. 9 0
      pages.json
  2. 42 0
      pages/launch/launch.vue
  3. 0 13
      pages/login/wxLogin.vue

+ 9 - 0
pages.json

@@ -1,5 +1,14 @@
 {
 	"pages": [
+		{
+			"path": "pages/launch/launch",
+			"style": {
+				"navigationStyle": "custom",
+				"app-plus": {
+					"animationType": "fade-in" // 可选,优化启动动画
+				}
+			}
+		},
 		{
 			"path": "pages/login/wxLogin",
 			"style": {

+ 42 - 0
pages/launch/launch.vue

@@ -0,0 +1,42 @@
+<template>
+	<view class="launch-container"></view>
+</template>
+
+<script>
+	export default {
+		data(){
+			return {
+				
+			}
+		},
+		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
+			}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>

+ 0 - 13
pages/login/wxLogin.vue

@@ -21,19 +21,6 @@
 				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')){