jiajunchen 11 godzin temu
rodzic
commit
259c2850d7
1 zmienionych plików z 16 dodań i 2 usunięć
  1. 16
    2
      src/router/index.ts

+ 16
- 2
src/router/index.ts Wyświetl plik

@@ -708,7 +708,9 @@ const router = createRouter({
708 708
 
709 709
 	]
710 710
 })
711
-
711
+function isInWeCom(): boolean {
712
+	return /wxwork/i.test(navigator.userAgent);
713
+}
712 714
 // 路由守卫
713 715
 router.beforeEach(async (to, from, next) => {
714 716
 
@@ -785,7 +787,13 @@ router.beforeEach(async (to, from, next) => {
785 787
 		return null; // 或者抛出错误,根据你的业务需求
786 788
 	}
787 789
 	console.log(to);
788
-	if (to.path == '/Home1'||to.path=='/yinhuan/todo_detail/index'|| to.path == '/lz-rcd-detail'||to.path == '/emergencyResources'||to.path == '/cardManager/specialWork'||to.path == '/cardManager/equipment'||to.path == '/cardManager/engineer') {
790
+	if (to.path == '/Home1'
791
+		||to.path=='/yinhuan/todo_detail/index'||
792
+		to.path == '/lz-rcd-detail'||to.path == '/emergencyResources'||
793
+		to.path == '/cardManager/specialWork'||to.path == '/cardManager/equipment'||
794
+		to.path == '/cardManager/engineer'||to.path =='/fcbkdatistart') {
795
+		console.log("++++++判断一下是不是企微或者掌上山钢扫码:"+isInWeCom());
796
+
789 797
 
790 798
 		/*const token = localStorage.getItem('token');
791 799
 		// 判断是否已经初始化过用户信息
@@ -821,6 +829,12 @@ router.beforeEach(async (to, from, next) => {
821 829
 					showFailToast("获取信息失败,请联系管理员")
822 830
 					window.history.back();
823 831
 				} else {
832
+					if (to.path =='/fcbkdatistart'){
833
+						if ( !isInWeCom()) {
834
+							//如果不是企业微信(掌上山钢扫码)
835
+
836
+
837
+						}
824 838
 					// 如果没有历史记录,跳转到首页或其他页面
825 839
 					router.push('/login');
826 840
 				}

Ładowanie…
Anuluj
Zapisz