|
@@ -1,5 +1,5 @@
|
|
|
|
|
|
-// import carhelp from '@/utils/mixin.js'
|
|
|
|
|
|
+// import carhelp from '@/utils/mixin.js'
|
|
|
|
|
|
import Vue from 'vue'
|
|
import Vue from 'vue'
|
|
import uniCrazyRouter from "uni-crazy-router";
|
|
import uniCrazyRouter from "uni-crazy-router";
|
|
@@ -10,29 +10,29 @@ Vue.use(uniCrazyRouter)
|
|
|
|
|
|
uniCrazyRouter.beforeEach(async (to, from, next) => {
|
|
uniCrazyRouter.beforeEach(async (to, from, next) => {
|
|
|
|
|
|
-
|
|
|
|
- routerBeforeEach(to, from, next);
|
|
|
|
|
|
+
|
|
|
|
+ routerBeforeEach(to, from, next);
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
uniCrazyRouter.afterEach((to, from) => {
|
|
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+')',
|
|
|
|
-
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ console.log("afterEach")
|
|
|
|
+ if(process.car.NODE_ENV=='dev'||process.car.NODE_ENV=='test'){
|
|
|
|
+ uni.setNavigationBarTitle({
|
|
|
|
+ title:'荆州工会鹊桥('+process.car.NODE_ENV+')',
|
|
|
|
+
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
uniCrazyRouter['on' + 'Error']((to, from) => {
|
|
uniCrazyRouter['on' + 'Error']((to, from) => {
|
|
// 逻辑代码
|
|
// 逻辑代码
|
|
- console.log("Error+start")
|
|
|
|
- console.log(to)
|
|
|
|
- console.log(from)
|
|
|
|
- console.log("Error+end")
|
|
|
|
|
|
+ console.log("Error+start")
|
|
|
|
+ console.log(to)
|
|
|
|
+ console.log(from)
|
|
|
|
+ console.log("Error+end")
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
@@ -44,10 +44,10 @@ Vue.use(Router)
|
|
const router = new Router()
|
|
const router = new Router()
|
|
|
|
|
|
// 路由全局拦截器 在这里处理登录、授权等相关操作
|
|
// 路由全局拦截器 在这里处理登录、授权等相关操作
|
|
-router.beforeEach(function(to, from, next) {
|
|
|
|
|
|
+router.beforeEach(function(to, from, next) {
|
|
|
|
|
|
- console.log('前置守卫')
|
|
|
|
- routerBeforeEach(to, from, next);
|
|
|
|
|
|
+ console.log('前置守卫')
|
|
|
|
+ routerBeforeEach(to, from, next);
|
|
|
|
|
|
})
|
|
})
|
|
|
|
|
|
@@ -65,4 +65,4 @@ router.onError(function(e) {
|
|
console.log('错误:', e.message || '路由跳转失败')
|
|
console.log('错误:', e.message || '路由跳转失败')
|
|
})
|
|
})
|
|
|
|
|
|
-export default router
|
|
|
|
|
|
+export default router
|