|
|
@@ -6,33 +6,11 @@
|
|
|
<div slot="header" class="clearfix">
|
|
|
<el-row>
|
|
|
<span v-html="article.title" />
|
|
|
- <span v-if="article.originalUrl !== null">
|
|
|
- <a style="text-decoration-line: none" target="_blank" :href="`${article.originalUrl}`">
|
|
|
- 原始链接
|
|
|
- </a>
|
|
|
- </span>
|
|
|
</el-row>
|
|
|
<el-divider />
|
|
|
<el-row>
|
|
|
<span v-html="article.publishAt" />
|
|
|
</el-row>
|
|
|
-<!-- <el-row v-if="userAvatar !== null">
|
|
|
- <el-col :md="2">
|
|
|
- <router-link target="_blank" :to="`/user/` + userAvatar.userId">
|
|
|
- <el-avatar>
|
|
|
- <el-image :src="userAvatar.avatarUrl" />
|
|
|
- </el-avatar>
|
|
|
- </router-link>
|
|
|
- </el-col>
|
|
|
- <el-col :md="10">
|
|
|
- <el-row>
|
|
|
- <span v-html="userAvatar.screenName" />
|
|
|
- </el-row>
|
|
|
- <el-row>
|
|
|
- <span>-</span>
|
|
|
- </el-row>
|
|
|
- </el-col>
|
|
|
- </el-row>-->
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
<el-row>
|
|
|
@@ -40,9 +18,6 @@
|
|
|
</el-row>
|
|
|
<el-divider />
|
|
|
<el-row>
|
|
|
- <span>
|
|
|
- <i :class="collectedIcon" @click="collectItem" />
|
|
|
- </span>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
@@ -68,7 +43,7 @@
|
|
|
<script>
|
|
|
// import { getArticle } from '@/api/article'
|
|
|
// import { getUserInfo } from '@/api/user'
|
|
|
-import { getNewsDetail } from '@/api/news'
|
|
|
+import { getBlogPost, getNewsDetail } from '@/api/blog'
|
|
|
|
|
|
export default {
|
|
|
name: 'ArticlePage',
|
|
|
@@ -98,19 +73,17 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
const articleId = this.$route.params.articleId
|
|
|
- getNewsDetail(articleId).then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.article = resp.data
|
|
|
- document.title = this.article.title
|
|
|
- /* getUserInfo(this.article.userId).then(resp => {
|
|
|
- if (resp.code === 0) {
|
|
|
- this.userAvatar = resp.data
|
|
|
- }
|
|
|
- })*/
|
|
|
- }
|
|
|
- })
|
|
|
+ this.getData(articleId)
|
|
|
},
|
|
|
methods: {
|
|
|
+ getData(articleId) {
|
|
|
+ getBlogPost(articleId).then(resp => {
|
|
|
+ if (resp.code === 0) {
|
|
|
+ this.article = resp.data
|
|
|
+ document.title = this.article.title
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
collectItem() {
|
|
|
this.$message.info('暂未实现')
|
|
|
if (this.collected) {
|