diff --git a/src/router/index.js b/src/router/index.js index 1bb2648..fbe073d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -44,283 +44,283 @@ import switchUser from '@/views/answerRank/switchUser.vue' //切换 Vue.use(VueRouter) const [routerPush, routerReplace] = [VueRouter.prototype.push, VueRouter.prototype.replace]; -VueRouter.prototype.push = function push(to) { +VueRouter.prototype.push = function push (to) { return routerPush.call(this, to).catch(err => err) } -VueRouter.prototype.replace = function replace(location) { +VueRouter.prototype.replace = function replace (location) { return routerReplace.call(this, location).catch(error => error); }; const routes = [{ - path: '/', - name: 'ServiceKQ', - component: ServiceKQ, - meta: { - title: '红色网上游' - } - }, { - path: '/home', - name: 'Home', - component: Home, - meta: { - title: '红色网上游' - } - }, - { - path: '/home_user_info', - name: 'HomeUserInfo', - component: HomeUserInfo, - meta: { - title: '红色网上游' - } - }, - { - path: '/abroad_detail', - name: 'ServiceAbroadDetail', - component: ServiceAbroadDetail, - meta: { - title: '红色网上游' - } - }, + path: '/', + name: 'ServiceKQ', + component: ServiceKQ, + meta: { + title: '红色网上游' + } +}, { + path: '/home', + name: 'Home', + component: Home, + meta: { + title: '红色网上游' + } +}, +{ + path: '/home_user_info', + name: 'HomeUserInfo', + component: HomeUserInfo, + meta: { + title: '红色网上游' + } +}, +{ + path: '/abroad_detail', + name: 'ServiceAbroadDetail', + component: ServiceAbroadDetail, + meta: { + title: '红色网上游' + } +}, - { - path: '/service_orderXST', - name: 'ServiceOrderXST', - component: ServiceOrderXST, - meta: { - title: '我的评价' - } - }, - { - path: '/evaluateCourse', - name: 'evaluateCourse', - component: evaluateCourse, - meta: { - title: '评价' - } - }, - { - path: '/evaluateBase', - name: 'evaluateBase', - component: evaluateBase, - meta: { - title: '基地评价' - } - }, - { - path: '/evaluateDetail', - name: 'evaluateDetail', - component: evaluateDetail, - meta: { - title: '评价详情' - } - }, - { - path: '/service_abroad_evaluate', - name: 'ServiceAbroadEvaluate', - component: ServiceAbroadEvaluate, - meta: { - title: '评价' - } - }, - { - path: '/YanxueCode', - name: 'YanxueCode', - component: YanxueCode, - meta: { - title: '研学码' - } - }, - { - path: '/YanxueInfo', - name: 'YanxueInfo', - component: YanxueInfo, - meta: { - title: '研学码信息' - } - }, - { - path: '/chooseSchool', - name: 'chooseSchool', - component: chooseSchool, - meta: { - title: '选择学校' - } - }, - { - path: '/select_contact', - name: 'SelectContact', - component: SelectContact, - meta: { - title: '选择出行人' - } - }, - { - path: '/edit_contact', - name: 'EditContact', - component: EditContact, - meta: { - title: '修改出行人' - } - }, - { - path: '/MyClassList', - name: 'MyClassList', - component: MyClassList, - meta: { - title: '基地签到' - } - }, - { - path: '/StudentDetail', - name: 'StudentDetail', - component: StudentDetail, - meta: { - title: '学生信息' - } - }, - { - path: '/payneed', - name: 'payneed', - component: payneed, - meta: { - title: '购买须知' - } - }, - { - path: '/protocol', - name: 'protocol', - component: protocol, - meta: { - title: '用户协议' - } - }, - { - path: '/schoolFollow', - name: 'schoolFollow', - component: schoolFollow, - meta: { - title: '关注学校' - } - }, - { - path: '/schoolAttestation', - name: 'schoolAttestation', - component: schoolAttestation, - meta: { - title: '已认证学校' - } - }, - { - path: '/classAttestation', - name: 'classAttestation', - component: classAttestation, - meta: { - title: '集团认领' - } - }, - { - path: '/YanxuePage', - name: 'YanxuePage', - component: YanxuePage, - meta: { - title: '每日一习' - } - }, - { - path: '/achievements', - name: 'achievements', - component: achievements, - meta: { - title: '研学成果' - } - }, - { - path: '/achievementsOne', - name: 'achievementsOne', - component: achievementsOne, - meta: { - title: '研学成果' - } - }, - { - path: '/chooseSchoolOne', - name: 'chooseSchoolOne', - component: chooseSchoolOne, - meta: { - title: '选择学校' - } - }, - { - path: '/pageDetails', - name: 'pageDetails', - component: pageDetails, - meta: { - title: '研学成果' - } - }, - { - path: '/rank', - name: 'rank', - component: rank, - meta: { - title: '排行榜' - } - }, - { - path: '/ans_rank', - name: 'ans_rank', - component: ans_rank, - meta: { - title: '排行榜' - } - }, - { - path: '/brush_questions', - name: 'brush_questions', - component: brush_questions, - meta: { - title: '刷题记录' - } - }, - { - path: '/category', - name: 'category', - component: category, - meta: { - title: '题库' - } - }, - { - path: '/stars', - name: 'stars', - component: stars, - meta: { - title: '五星少年' - } - }, - { - path: '/ans_question', - name: 'ans_question', - component: ans_question, - meta: { - title: '答题' - } - }, - { - path: '/switchUser', - name: 'switchUser', - component: switchUser, - meta: { - title: '切换用户' - } - }, - { - path: '/YanxueDetail', - name: 'YanxueDetail', - component: YanxueDetail, - meta: {} - }, +{ + path: '/service_orderXST', + name: 'ServiceOrderXST', + component: ServiceOrderXST, + meta: { + title: '我的评价' + } +}, +{ + path: '/evaluateCourse', + name: 'evaluateCourse', + component: evaluateCourse, + meta: { + title: '评价' + } +}, +{ + path: '/evaluateBase', + name: 'evaluateBase', + component: evaluateBase, + meta: { + title: '基地评价' + } +}, +{ + path: '/evaluateDetail', + name: 'evaluateDetail', + component: evaluateDetail, + meta: { + title: '评价详情' + } +}, +{ + path: '/service_abroad_evaluate', + name: 'ServiceAbroadEvaluate', + component: ServiceAbroadEvaluate, + meta: { + title: '评价' + } +}, +{ + path: '/YanxueCode', + name: 'YanxueCode', + component: YanxueCode, + meta: { + title: '研学码' + } +}, +{ + path: '/YanxueInfo', + name: 'YanxueInfo', + component: YanxueInfo, + meta: { + title: '研学码信息' + } +}, +{ + path: '/chooseSchool', + name: 'chooseSchool', + component: chooseSchool, + meta: { + title: '选择学校' + } +}, +{ + path: '/select_contact', + name: 'SelectContact', + component: SelectContact, + meta: { + title: '选择出行人' + } +}, +{ + path: '/edit_contact', + name: 'EditContact', + component: EditContact, + meta: { + title: '修改出行人' + } +}, +{ + path: '/MyClassList', + name: 'MyClassList', + component: MyClassList, + meta: { + title: '基地签到' + } +}, +{ + path: '/StudentDetail', + name: 'StudentDetail', + component: StudentDetail, + meta: { + title: '学生信息' + } +}, +{ + path: '/payneed', + name: 'payneed', + component: payneed, + meta: { + title: '购买须知' + } +}, +{ + path: '/protocol', + name: 'protocol', + component: protocol, + meta: { + title: '用户协议' + } +}, +{ + path: '/schoolFollow', + name: 'schoolFollow', + component: schoolFollow, + meta: { + title: '关注学校' + } +}, +{ + path: '/schoolAttestation', + name: 'schoolAttestation', + component: schoolAttestation, + meta: { + title: '已认证学校' + } +}, +{ + path: '/classAttestation', + name: 'classAttestation', + component: classAttestation, + meta: { + title: '集团认领' + } +}, +{ + path: '/YanxuePage', + name: 'YanxuePage', + component: YanxuePage, + meta: { + title: '每日一习' + } +}, +{ + path: '/achievements', + name: 'achievements', + component: achievements, + meta: { + title: '研学成果' + } +}, +{ + path: '/achievementsOne', + name: 'achievementsOne', + component: achievementsOne, + meta: { + title: '研学成果' + } +}, +{ + path: '/chooseSchoolOne', + name: 'chooseSchoolOne', + component: chooseSchoolOne, + meta: { + title: '选择学校' + } +}, +{ + path: '/pageDetails', + name: 'pageDetails', + component: pageDetails, + meta: { + title: '研学成果' + } +}, +{ + path: '/rank', + name: 'rank', + component: rank, + meta: { + title: '排行榜' + } +}, +{ + path: '/ans_rank', + name: 'ans_rank', + component: ans_rank, + meta: { + title: '排行榜' + } +}, +{ + path: '/brush_questions', + name: 'brush_questions', + component: brush_questions, + meta: { + title: '刷题记录' + } +}, +{ + path: '/category', + name: 'category', + component: category, + meta: { + title: '题库' + } +}, +{ + path: '/stars', + name: 'stars', + component: stars, + meta: { + title: '五星少年' + } +}, +{ + path: '/ans_question', + name: 'ans_question', + component: ans_question, + meta: { + title: '答题' + } +}, +{ + path: '/switchUser', + name: 'switchUser', + component: switchUser, + meta: { + title: '切换用户' + } +}, +{ + path: '/YanxueDetail', + name: 'YanxueDetail', + component: YanxueDetail, + meta: {} +}, ] const router = new VueRouter({ @@ -332,7 +332,10 @@ const router = new VueRouter({ router.beforeEach((to, from, next) => { /* 路由发生变化修改页面title */ if (to.meta.title) { - document.title = to.meta.title + // document.title = to.meta.title + ZWJSBridge.setTitle({ + "title": to.meta.title + }) } next() }) -- libgit2 0.21.0