🎨 接口数据结构变更

This commit is contained in:
ronger 2022-08-01 21:49:48 +08:00
parent 4d5f95f7dd
commit 46f6b06fb7
2 changed files with 7 additions and 10 deletions

View File

@ -76,15 +76,12 @@ export default {
idArticle: _ts.idArticle,
articleTags: _ts.articleTags.join(',')
}).then(function (res) {
console.log(res)
if (res) {
if (res.success) {
_ts.$emit('closeDialog');
} else {
_ts.$message(res.message)
}
} else {
_ts.$message("更新失败!")
}
})
}
},

View File

@ -69,7 +69,7 @@
</client-only>
</el-col>
<el-col v-if="isShare" style="margin-bottom: 1rem;">
<share-box :url="shareData.shareUrl"></share-box>
<share-box :url="shareUrl"></share-box>
</el-col>
<el-col v-if="article.portfolios && article.portfolios.length > 0">
<portfolios-widget :portfolios="article.portfolios"></portfolios-widget>
@ -257,7 +257,7 @@ export default {
isShare: false,
dialogVisible: false,
isPerfect: false,
shareData: {}
shareUrl: ''
}
},
methods: {
@ -283,12 +283,12 @@ export default {
if (_ts.user) {
_ts.$axios.$get('/api/article/' + _ts.article.idArticle + '/share').then(function (res) {
if (res) {
_ts.$set(_ts, 'shareData', res);
_ts.$set(_ts, 'shareUrl', res);
_ts.$set(_ts, 'isShare', true);
}
});
} else {
_ts.$set(_ts, 'shareData', {shareUrl: _ts.article.articlePermalink});
_ts.$set(_ts, 'shareUrl', _ts.article.articlePermalink);
_ts.$set(_ts, 'isShare', true);
}
}