From 53a93f661204ba59f65848e81475faf1105e196a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B2=88=E5=AD=A6=E5=9D=A4?= <1107410514@qq.com> Date: Thu, 17 Oct 2019 23:16:38 +0800 Subject: [PATCH] kun 19/1017 23:17 --- src/http.js | 4 ++-- src/router.js | 2 +- src/views/home/HomePage.vue | 2 +- src/views/home/NewsDetails.vue | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/http.js b/src/http.js index 1b597f8..b4e3f89 100644 --- a/src/http.js +++ b/src/http.js @@ -25,7 +25,7 @@ axios.interceptors.response.use( response => { if (response.data.errno === 999) { router.replace('/') - console.log('token过期') + // console.log('token过期') } return response }, @@ -39,7 +39,7 @@ router.beforeEach((to, from, next) => { // 判断该路由是否需要登录权限 if (sessionStorage.id) { // 获取当前的token是否存在 - console.log('token存在') + // console.log('token存在') next() // if (to.name !== 'application') { diff --git a/src/router.js b/src/router.js index 46ca108..a982708 100644 --- a/src/router.js +++ b/src/router.js @@ -190,7 +190,7 @@ export default new Router({ }, /** 新闻详情 */ { - path: '/newsDetails', + path: '/newsDetails:id', name: 'newsDetails', component: NewsDetails }, diff --git a/src/views/home/HomePage.vue b/src/views/home/HomePage.vue index 8cf460e..c66801b 100644 --- a/src/views/home/HomePage.vue +++ b/src/views/home/HomePage.vue @@ -234,7 +234,7 @@ export default { }); setTimeout(() => { loading.close(); - }, 2000); + }, 1000); }, link(href) { window.location.href = href diff --git a/src/views/home/NewsDetails.vue b/src/views/home/NewsDetails.vue index 712b06b..2cb1feb 100644 --- a/src/views/home/NewsDetails.vue +++ b/src/views/home/NewsDetails.vue @@ -155,8 +155,8 @@ export default { // let type = this.$route.params.type // this.getData(this.id) }, - mounted() { - this.id = this.$route.params.id + mounted() { + this.id = this.$route.params.id let type = this.$route.params.type this.getData(this.id) }