Files
ZhHealth/router/index.js

53 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {
RouterMount,
createRouter
} from 'uni-simple-router';
import store from '@/store/index'
// #ifdef APP-NVUE
// CALL 页面必须是nvue但是NVUE 不支持webpack的 ROUTES 注入
// https://github.com/SilurianYang/uni-read-pages/issues/20
const ROUTES = [{
'path': '/pages/im/private/call',
'name': 'imPrivateCall'
},{
'path': '/pages/im/private/chat',
'name': 'imPrivateChat'
},{
'path': '/pages/im/group/chat',
'name': 'imGroupChat'
},{
'path': '/pages/im/group/info',
'name': 'imGroupInfo'
},{
'path': '/pages/im/group/index',
'name': 'imGroups'
},{
'path': '/pages/im/group/create',
'name': 'imGroupCreate'
}]
// #endif
const router = createRouter({
platform: process.env.VUE_APP_PLATFORM,
routes: [...ROUTES]
});
// console.log(...ROUTES)
//全局路由前置守卫
router.beforeEach((to, from, next) => {
next();
});
// 全局路由后置守卫
router.afterEach((to, from) => {
// console.log('跳转结束')
})
export {
router,
RouterMount
}