|
@@ -6,8 +6,14 @@
|
|
<span class="date">{{ data }}</span>
|
|
<span class="date">{{ data }}</span>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="12" class="login">
|
|
<el-col :span="12" class="login">
|
|
- <el-button size="mini" @click="$router.push({ path: '/login' })">登录</el-button>
|
|
|
|
- <el-button size="mini" @click="$router.push({ path: '/register' })">注册</el-button>
|
|
|
|
|
|
+ <span v-if="user.uid == null">
|
|
|
|
+ <el-button size="mini" @click="$router.push({ path: '/login' })">登录</el-button>
|
|
|
|
+ <el-button size="mini" @click="$router.push({ path: '/register' })">注册</el-button>
|
|
|
|
+ </span>
|
|
|
|
+ <span v-else>
|
|
|
|
+ <span style="padding:0 15px 0 0;">{{ user.name }}</span>
|
|
|
|
+ <el-button @click="$router.push({ path: '/pcenter/index' })">个人中心</el-button>
|
|
|
|
+ </span>
|
|
</el-col>
|
|
</el-col>
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
@@ -31,6 +37,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import moment from 'moment';
|
|
import moment from 'moment';
|
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
export default {
|
|
export default {
|
|
name: 'logo',
|
|
name: 'logo',
|
|
props: {},
|
|
props: {},
|
|
@@ -44,7 +51,9 @@ export default {
|
|
created() {
|
|
created() {
|
|
this.searchdate();
|
|
this.searchdate();
|
|
},
|
|
},
|
|
- computed: {},
|
|
|
|
|
|
+ computed: {
|
|
|
|
+ ...mapState(['user']),
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
searchdate() {
|
|
searchdate() {
|
|
let date = moment().format('YYYY-MM-DD ');
|
|
let date = moment().format('YYYY-MM-DD ');
|