文章评论模块加载问题修复

This commit is contained in:
x ronger 2020-08-02 19:24:48 +08:00
parent 47984f5638
commit ffe8c1879e
3 changed files with 5 additions and 10 deletions

View File

@ -1,7 +1,7 @@
<template>
<el-row class="pt-5">
<el-col>
<el-col v-show="user" style="margin-top: 1rem;">
<el-col v-if="user" style="margin-top: 1rem;">
<el-col :xs="2" :sm="1" :xl="1">
<el-avatar :src="avatar"></el-avatar>
</el-col>
@ -28,7 +28,7 @@
</el-drawer>
</el-col>
</el-col>
<el-col v-show="!user" class="text-center" style="margin-top: 1rem;">
<el-col v-else class="text-center" style="margin-top: 1rem;">
<el-button type="primary" size="medium" @click="gotoLogin">登录</el-button>
后发布评论
</el-col>
@ -62,7 +62,7 @@
<el-col :span="22" style="padding-left: 1rem;">
<el-link :underline="false" class="text-default">{{ comment.timeAgo }}</el-link>
</el-col>
<el-col :span="2" class="text-right" style="margin-bottom: 0.5rem;">
<el-col :span="2" v-if="user" class="text-right" style="margin-bottom: 0.5rem;">
<el-link :underline="false" title="回复" @click.native="replyComment(comment)"><i
class="el-icon-s-comment"></i></el-link>
</el-col>

View File

@ -3,7 +3,7 @@ export default function ({app, $axios, store, redirect}) {
$axios.onRequest(config => {
let token = store.state.oauth?.accessToken;
if (token) {
if (!(config.url.indexOf('console') > -1)) {
if (!(config.url.indexOf('console') > -1 || config.url.indexOf('comments') > -1)) {
config.headers['Authorization'] = store.state.oauth?.accessToken
}
}
@ -42,7 +42,7 @@ export default function ({app, $axios, store, redirect}) {
if (code === 400) {
redirect('/400');
} else {
console.log(error, error.data);
console.log(error.data);
}
})
}

View File

@ -36,7 +36,6 @@ export const mutations = {
state.list.data.data.push(...action.data)
state.list.data.pagination = action.pagination
},
// 文章详情
updateDetailFetching(state, action) {
state.detail.fetching = action
@ -69,14 +68,11 @@ export const actions = {
topicUri: params.topic_uri || ''
}
console.log('data:', data)
return this.$axios
.$get(`${BASE_API_PATH}/articles`, {
params: data
})
.then(response => {
console.log('response', response);
commit('updateListFetching', false);
commit('updateListData', response);
})
@ -85,7 +81,6 @@ export const actions = {
commit('updateListFetching', false);
});
},
// 获取文章详情
fetchDetail({ commit }, params = {}) {
// const delay = fetchDelay(