diff --git a/src/components/HeaderNav.vue b/src/components/HeaderNav.vue index 1fe08a0..a33b5f5 100644 --- a/src/components/HeaderNav.vue +++ b/src/components/HeaderNav.vue @@ -41,12 +41,16 @@ export default { watch: {}, methods: { judge () { - if (sessionStorage.token) { + if (sessionStorage.id) { this.name = sessionStorage.name this.enter = false } }, quit () { + this.$router.push({ + name: 'homePage' + }) + this.$message.success('退出成功!') sessionStorage.clear() this.enter = true } diff --git a/src/components/PagingDevice.vue b/src/components/PagingDevice.vue new file mode 100644 index 0000000..069c495 --- /dev/null +++ b/src/components/PagingDevice.vue @@ -0,0 +1,109 @@ + + + + + diff --git a/src/http.js b/src/http.js index 2a0c2e8..1b597f8 100644 --- a/src/http.js +++ b/src/http.js @@ -12,9 +12,9 @@ axios.interceptors.request.use(config => { ) { // 如果是登录和注册操作,则不需要携带header里面的token } else { - if (sessionStorage.token) { + if (sessionStorage.id) { config.headers = { - Authorization: sessionStorage.token + Authorization: sessionStorage.id } } } @@ -37,23 +37,25 @@ axios.interceptors.response.use( router.beforeEach((to, from, next) => { if (to.meta.requireAuth) { // 判断该路由是否需要登录权限 - if (sessionStorage.token) { + if (sessionStorage.id) { // 获取当前的token是否存在 console.log('token存在') - if (to.name !== 'application') { - next() - } else { - if ( - sessionStorage.party_id !== 'null') { - next() - } else { - alert('请先成为党组织!') - next({ - path: '/', // 将跳转的路由path作为参数,登录成功后跳转到该路由 - query: { redirect: to.fullPath } - }) - } - } + next() + + // if (to.name !== 'application') { + // next() + // } else { + // if ( + // sessionStorage.party_id !== 'null') { + // next() + // } else { + // alert('请先成为党组织!') + // next({ + // path: '/', // 将跳转的路由path作为参数,登录成功后跳转到该路由 + // query: { redirect: to.fullPath } + // }) + // } + // } } else { alert('请先登录!') next({ diff --git a/src/router.js b/src/router.js index 50b2fc5..92342ea 100644 --- a/src/router.js +++ b/src/router.js @@ -5,6 +5,8 @@ import Router from 'vue-router' import HeaderNav from './components/HeaderNav' /** 尾部导航 */ import FooterNav from './components/FooterNav' +/** 分页器 */ +import PagingDevice from './components/PagingDevice' /** 首页 */ import HomePage from './views/home/HomePage' @@ -55,13 +57,16 @@ export default new Router({ name: 'footerNav', component: FooterNav }, + /** 分页器 */ + { + path: '/pagingDevice', + name: 'pagingDevice', + component: PagingDevice + }, /** 信息查询 */ { path: '/informationQuery', name: 'informationQuery', - meta: { - requireAuth: true - }, component: InformationQuery }, /** 修改密码 */ diff --git a/src/views/InformationQuery.vue b/src/views/InformationQuery.vue index 66707d2..5c751f5 100644 --- a/src/views/InformationQuery.vue +++ b/src/views/InformationQuery.vue @@ -14,25 +14,25 @@
- @@ -56,12 +57,12 @@ export default { this.$message.success('登陆成功') this.$router.push('/') // 全局存储token - window.sessionStorage['token'] = res.data.data.data.id + window.sessionStorage['id'] = res.data.data.data.id window.sessionStorage['name'] = res.data.data.data.name window.sessionStorage['party_id'] = res.data.data.data.party_id window.sessionStorage['party_name'] = res.data.data.data.party_name } else { - alert('登入失败!') + alert(res.data.data.msg) } }) // eslint-disable-next-line handle-callback-err @@ -199,7 +200,9 @@ export default { } h3 { - font-family: "HanWangKaiBold-Gb5"; + // font-family: "HanWangKaiBold-Gb5"; + font-family: "MicrosoftYaHei"; + font-size: 26px; font-weight: normal; font-stretch: normal; diff --git a/src/views/Registered.vue b/src/views/Registered.vue index e6d9b0f..1b92437 100644 --- a/src/views/Registered.vue +++ b/src/views/Registered.vue @@ -3,11 +3,7 @@

立 即 注 冊

-
+ -