Merge branch 'master' of https://gitea.hmily.club/haitu/aigc-h5
commit
ad8ae50056
|
|
@ -15,7 +15,7 @@
|
|||
<span>{{ DateFormat(new Date(detail.published_at * 1000), 'yyyy.MM.dd') }}</span>
|
||||
</div>
|
||||
<div class="info">
|
||||
<div v-html="detail.content"></div>
|
||||
<div v-html="detailContent"></div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="loadingBox" v-else>{{ placeholder }}</div>
|
||||
|
|
@ -64,6 +64,7 @@ const id = ref(props.id || route.params.id);
|
|||
const detail = ref();
|
||||
const recommend = ref([]);
|
||||
const placeholder = ref('数据加载中...');
|
||||
const detailContent = ref('');
|
||||
|
||||
const aiContent = computed(() => {
|
||||
return `标题${detail.value?.title}作者${detail.value?.author}责编${detail.value?.editor}发布时间${DateFormat(new Date(detail.value?.published_at * 1000), 'yyyy.MM.dd') }内容${detail.value?.content}`
|
||||
|
|
@ -83,6 +84,9 @@ const getDetail = () => {
|
|||
http(`/api/article/${id.value}`, {}, 'get').then(res => {
|
||||
detail.value = res.data;
|
||||
// website.setPageTitle(res.data.title);
|
||||
let _content = res.data.content;
|
||||
let reg = /font-size:\s?\d+px;/gi;
|
||||
detailContent.value = _content.replace(reg, '');
|
||||
}).catch(err => {
|
||||
showToast(err.message);
|
||||
if(err.status == 1001){
|
||||
|
|
@ -170,8 +174,8 @@ const goDetail = (id) => {
|
|||
padding: 20px 0;
|
||||
|
||||
.title {
|
||||
font-size: 26px;
|
||||
line-height: 30px;
|
||||
font-size: 30px;
|
||||
line-height: 40px;
|
||||
font-weight: bold;
|
||||
color: #FFF;
|
||||
text-align: center;
|
||||
|
|
@ -193,7 +197,7 @@ const goDetail = (id) => {
|
|||
|
||||
.info {
|
||||
line-height: 1.5;
|
||||
font-size: 23px;
|
||||
font-size: 24px;
|
||||
|
||||
:deep(p) {
|
||||
padding: 10px 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue