:bugs: 头像显示及昵称获取问题修复

This commit is contained in:
ronger 2020-08-11 14:41:48 +08:00
parent c5afbd0a60
commit ce2ff27f8f
6 changed files with 16 additions and 10 deletions

View File

@ -41,7 +41,7 @@
},
methods: {
share(url) {
let path = url + '?s=' + this.$store.state.oauth.nickname
let path = url + '?s=' + this.$store.state.userInfo?.nickname
return path;
}
}

View File

@ -102,10 +102,10 @@
isFetching: state => state.article.detail.fetching,
isMobile: state => state.global.isMobile,
user: state => state.oauth,
avatar: state => state.oauth?.avatarURL
avatar: state => state.userInfo?.avatarURL
}),
hasPermissions() {
let account = this.$store.state.oauth?.nickname;
let account = this.$store.state.userInfo?.nickname;
if (account) {
if (account === this.article.articleAuthor.userNickname) {
return true;

View File

@ -89,10 +89,10 @@
isFetching: state => state.draft.detail.fetching,
isMobile: state => state.global.isMobile,
user: state => state.oauth,
avatar: state => state.oauth?.avatarURL
avatar: state => state.userInfo?.avatarURL
}),
hasPermissions() {
let account = this.$store.state.oauth?.nickname;
let account = this.$store.state.userInfo?.nickname;
if (account) {
if (account === this.article?.articleAuthor?.userNickname) {
return true;

View File

@ -61,10 +61,10 @@
isFetching: state => state.portfolio.detail.fetching,
isMobile: state => state.global.isMobile,
user: state => state.oauth,
avatar: state => state.oauth?.avatarURL
avatar: state => state.userInfo?.avatarURL
}),
isAuthor() {
let account = this.$store.state.oauth?.nickname;
let account = this.$store.state.userInfo?.nickname;
if (account) {
if (account === this.portfolio.portfolioAuthor.userNickname) {
return true;

View File

@ -69,7 +69,7 @@
portfolio: state => state.portfolio.detail.data
}),
isAuthor() {
let account = this.$store.state.oauth?.nickname;
let account = this.$store.state.userInfo?.nickname;
if (account) {
if (account === this.portfolio.portfolioAuthorName) {
return true;
@ -84,6 +84,12 @@
this.$router.push({
path: data
})
} else if (name === 'user') {
this.$router.push(
{
path: '/user/' + data
}
)
} else {
this.$router.push(
{

View File

@ -2,7 +2,7 @@
<el-row class="wrapper">
<el-col v-if="isEdit" style="margin-bottom: 1rem;">
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item :to="{ path: '/portfolio-manager/' + idPortfolio }">{{ portfolio.portfolioTitle }}
<el-breadcrumb-item :to="{ path: '/portfolio/manager/' + idPortfolio }">{{ portfolio.portfolioTitle }}
</el-breadcrumb-item>
<el-breadcrumb-item>更新作品集</el-breadcrumb-item>
</el-breadcrumb>
@ -259,7 +259,7 @@
_ts.$message(res.message);
} else {
_ts.$router.push({
path: '/user/' + _ts.$store.state.oauth.nickname
path: '/user/' + _ts.$store.state.userInfo?.nickname
})
}
}