zhengkaixin преди 4 години
родител
ревизия
188c213247
променени са 1 файла, в които са добавени 17 реда и са изтрити 1 реда
  1. 17 1
      bobo-router/index.js

+ 17 - 1
bobo-router/index.js

@@ -17,7 +17,23 @@ uniCrazyRouter.beforeEach(async (to, from, next) => {
 
 
 	// 逻辑代码
 	// 逻辑代码
 	console.log("beforeEach")
 	console.log("beforeEach")
-	routerBeforeEach(to, from, next);
+	if(to.url==from.url){
+		
+		var url="pages/index/index";
+		if(to.url.indexOf("pages/my")==0){
+			url="pages/my/index";
+		}
+		if(to.url.indexOf("pages/news")==0){
+			url="pages/news/index";
+		}
+		if(to.url.indexOf("pages/remind")==0){
+			url="pages/remind/index";
+		}
+		
+		window.location.href=window.location.href.split('#')[0]+"#/"+url
+	}else{
+		routerBeforeEach(to, from, next);
+	}
 })
 })
 
 
 uniCrazyRouter.afterEach((to, from) => {
 uniCrazyRouter.afterEach((to, from) => {