提交
This commit is contained in:
parent
4e228cadd1
commit
7b2c4584b4
@ -21,24 +21,25 @@
|
||||
<div class="head-arrows" :class="{ animation: headMorePopState }" v-if="headMorePopState"></div>
|
||||
<div class="head-more-pop" :class="{ animation: headMorePopState }">
|
||||
<div class="head-more-userinfo flex1 flexacenter">
|
||||
<div class="head-more-left flexacenter">
|
||||
<div class="head-more-left flexacenter" v-if="islogin">
|
||||
<router-link to="/user" @click.native="headMorePopState = !headMorePopState">
|
||||
<img class="head-more-userinfo-avatar" :src="userInfo.avatar || './img/defaultAvatar.jpg'" />
|
||||
<div class="head-more-userinfo-username">{{ userInfo.nickname || '未登录' }}</div>
|
||||
</router-link>
|
||||
|
||||
<div class="head-more-userinfo-username">
|
||||
{{ userInfo.nickname || '未登录' }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="head-more-left flexacenter" v-else @click="handleRegister()">
|
||||
<img class="head-more-userinfo-avatar" :src="userInfo.avatar || './img/defaultAvatar.jpg'" />
|
||||
<div class="head-more-userinfo-username">{{ userInfo.nickname || '未登录' }}</div>
|
||||
</div>
|
||||
|
||||
<div class="head-more-right">
|
||||
<!-- 消息 -->
|
||||
<div class="information-box" v-if="userInfo.messagenum">
|
||||
<!-- <img class="information-icon" src="@/assets/img/headerNav/information.png" /> -->
|
||||
<img class="information-icon" src="@/assets/img/icon/email.png" />
|
||||
<div class="red-dot flexcenter">{{ userInfo.messagenum }}</div>
|
||||
</div>
|
||||
<!-- 登录按钮 -->
|
||||
<div v-if="!islogin" class="loginBtn flexcenter" @click="handleRegister">
|
||||
<div v-if="!islogin" class="loginBtn flexcenter" @click="handleRegister()">
|
||||
登录/注册
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,6 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import VueRouter from 'vue-router'
|
||||
// import Recommend from "views/recommend/Recommend.vue"
|
||||
|
||||
Vue.use(VueRouter)
|
||||
|
||||
@ -8,10 +7,10 @@ const VueRouterPush = VueRouter.prototype.push
|
||||
VueRouter.prototype.push = function push(to) {
|
||||
return VueRouterPush.call(this, to).catch(err => err)
|
||||
}
|
||||
|
||||
//标题js
|
||||
import getPageTitle from "@/utils/title-config";
|
||||
|
||||
|
||||
const Index = () => import('views/index/index')
|
||||
const Recommend = () => import('views/index/recommend/Recommend')
|
||||
const Collect = () => import('views/index/collect/Collect')
|
||||
@ -105,7 +104,9 @@ const routes = [
|
||||
]
|
||||
|
||||
const router = new VueRouter({
|
||||
mode: 'history',
|
||||
// mode: 'history',
|
||||
// mode: 'hash',
|
||||
mode: process.env.NODE_ENV == "development" ? 'hash' : 'history',
|
||||
base: process.env.BASE_URL,
|
||||
routes
|
||||
})
|
||||
|
@ -30,6 +30,9 @@ service.interceptors.request.use(config => {
|
||||
//注意使用token的时候需要引入cookie方法或者用本地localStorage等方法,推荐js-cookie
|
||||
// config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
|
||||
// config['headers']['authorization'] = "661aiz52k5e6vqgmkxnz0wvbv8nciz8h"
|
||||
|
||||
if (process.env.NODE_ENV == "development") config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
|
||||
|
||||
return config
|
||||
}, error => {
|
||||
Promise.reject(error)
|
||||
|
Loading…
x
Reference in New Issue
Block a user