123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import Vue from 'vue'
- import VueRouter from 'vue-router'
- import Home from '../pages/Home.vue'
- import RuleDesc from "@/views/gui/RuleDesc.vue"
- import RuleDescMobile from "@/views/gui/RuleDescMobile.vue"
- import Login from "@/views/gui/Login.vue"
- import SignUp from "@/views/gui/SignUp.vue"
- import Share from "@/views/gui/Share.vue"
- import QuestionPositionTip from "@/views/gui/QuestionPositionTip.vue"
- const originalPush = VueRouter.prototype.push
- VueRouter.prototype.push = function push (location) {
- return originalPush.call(this, location).catch(err => err)
- }
- Vue.use(VueRouter)
- const routes = [
- {
- path: '/',
- name: 'Home',
- component: Home,
- beforeEnter: ((to, from, next) => {
- if (!to.query.m) {
- router.replace({
- path: '/',
- query: {
- m: 'SS-SbPlRnV7Wg',
- },
- })
- location.reload()
- } else {
- next()
- }
- }),
- children: [
- {
- path: 'rule-desc',
- name: 'RuleDesc',
- component: RuleDesc,
- },
- {
- path: 'rule-desc-mobile',
- name: 'RuleDescMobile',
- component: RuleDescMobile,
- },
- {
- path: 'login',
- name: 'Login',
- component: Login,
- },
- {
- path: 'sign-up',
- name: 'SignUp',
- component: SignUp,
- },
- {
- path: 'share',
- name: 'Share',
- component: Share,
- },
- {
- path: 'question-position-tip',
- name: 'QuestionPositionTip',
- component: QuestionPositionTip,
- },
- ]
- }
- ]
- const router = new VueRouter({
- routes
- })
- export default router
|