diff --git a/components/archive/list.vue b/components/archive/list.vue index 36256cb..111472d 100644 --- a/components/archive/list.vue +++ b/components/archive/list.vue @@ -31,7 +31,7 @@
- {{ article.articleAuthorName }} diff --git a/components/common/user/list.vue b/components/common/user/list.vue index 4f3c952..d0ff3ed 100644 --- a/components/common/user/list.vue +++ b/components/common/user/list.vue @@ -7,7 +7,7 @@
- + {{ user.nickname }} {{ user.signature }} diff --git a/components/layouts/mobile/header.vue b/components/layouts/mobile/header.vue index ae7ddd3..d3363fa 100644 --- a/components/layouts/mobile/header.vue +++ b/components/layouts/mobile/header.vue @@ -106,6 +106,18 @@ } return _ts.$store.state.userInfo?.nickname; }, + account() { + let _ts = this; + if (isBrowser) { + if (!_ts.$store.state.userInfo) { + let user = localStorage.getItem('user'); + if (user) { + _ts.$store.commit('setUser', JSON.parse(user)) + } + } + } + return _ts.$store.state.userInfo?.account; + }, hasPermissions() { return this.$store.getters.hasPermissions('blog_admin'); } @@ -154,7 +166,7 @@ switch (item) { case 'user': _ts.$router.push({ - path: '/user/' + _ts.nickname + path: '/user/' + _ts.account }) break; case 'user-info': diff --git a/components/layouts/pc/header.vue b/components/layouts/pc/header.vue index 32418dd..05b2ead 100644 --- a/components/layouts/pc/header.vue +++ b/components/layouts/pc/header.vue @@ -142,6 +142,18 @@ export default { } return _ts.$store.state.userInfo?.nickname; }, + account() { + let _ts = this; + if (isBrowser) { + if (!_ts.$store.state.userInfo) { + let user = localStorage.getItem('user'); + if (user) { + _ts.$store.commit('setUser', JSON.parse(user)) + } + } + } + return _ts.$store.state.userInfo?.account; + }, hasPermissions() { return this.$store.getters.hasPermissions('blog_admin'); } @@ -219,7 +231,7 @@ export default { switch (item) { case 'user': _ts.$router.push({ - path: '/user/' + _ts.nickname + path: '/user/' + _ts.account }) break; case 'user-info': diff --git a/pages/admin/users.vue b/pages/admin/users.vue index 09c2174..d727808 100644 --- a/pages/admin/users.vue +++ b/pages/admin/users.vue @@ -29,7 +29,7 @@ width="180" prop="nickname"> diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue index 5741d01..7bb74b3 100644 --- a/pages/article/_article_id.vue +++ b/pages/article/_article_id.vue @@ -17,7 +17,7 @@
- {{ article.articleAuthorName }} {{ article.timeAgo }} diff --git a/pages/article/post/_article_id.vue b/pages/article/post/_article_id.vue index 23006ee..be31e60 100644 --- a/pages/article/post/_article_id.vue +++ b/pages/article/post/_article_id.vue @@ -48,7 +48,6 @@