| 1234567891011121314151617181920212223242526272829303132 |
- // router.js
- import { RouterMount, createRouter, runtimeQuit } from '@/js_sdk/hhyang-uni-simple-router/uni-simple-router';
- import tools from "@/service/tools";
- import {userWxAppletLogin} from '@/api/user.js'
- const router = createRouter({
- platform: process.env.VUE_APP_PLATFORM,
- routerErrorEach:({type,level,...args})=>{
- // console.log({type,level,...args})
- // #ifdef APP-PLUS
- if(type===3){
- router.$lockStatus=false;
- tools.onBackPress()
- }
- // #endif
- },
- routes: [...ROUTES]
- });
- //全局路由前置守卫
- router.beforeEach( async (to, from, next) => {
- next()
- });
- // 全局路由后置守卫
- router.afterEach((to, from) => {
- // console.log('后置守卫to------', to)
- })
- export {
- router,
- RouterMount
- }
|