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