|
@@ -13,16 +13,31 @@ Vue.use(uniCrazyRouter)
|
|
|
//** 后续操作,访问的是 uniCrazyRouter的前置守卫
|
|
|
|
|
|
|
|
|
-uniCrazyRouter.beforeEach(async (to, from, next) => {
|
|
|
-
|
|
|
- // 逻辑代码
|
|
|
- console.log("beforeEach")
|
|
|
- routerBeforeEach(to, from, next);
|
|
|
+uniCrazyRouter.beforeEach(async (to, from, next) => {
|
|
|
+ // 逻辑代码
|
|
|
+ console.log("beforeEach")
|
|
|
+
|
|
|
+ if(to.url==from.url){
|
|
|
+
|
|
|
+ var url="pages/index/index";
|
|
|
+ if(to.url.indexOf("pages/order")==0){
|
|
|
+ url="pages/order/index";
|
|
|
+ }
|
|
|
+ if(to.url.indexOf("pages/wallet")==0){
|
|
|
+ url="pages/wallet/index";
|
|
|
+ }
|
|
|
+
|
|
|
+ window.location.href=window.location.href.split('#')[0]+"#/"+url
|
|
|
+ }else{
|
|
|
+ routerBeforeEach(to, from, next);
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
|
|
|
uniCrazyRouter.afterEach((to, from) => {
|
|
|
// 逻辑代码
|
|
|
console.log("afterEach")
|
|
|
+
|
|
|
if(process.car.NODE_ENV=='dev'||process.car.NODE_ENV=='test'){
|
|
|
uni.setNavigationBarTitle({
|
|
|
title:'车信达('+process.car.NODE_ENV+')',
|