: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: { methods: {
share(url) { share(url) {
let path = url + '?s=' + this.$store.state.oauth.nickname let path = url + '?s=' + this.$store.state.userInfo?.nickname
return path; return path;
} }
} }

View File

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

View File

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

View File

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

View File

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

View File

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