diff --git a/src/components/article/indexNewsInfo.vue b/src/components/article/indexNewsInfo.vue index fc9d2af..56c2cf3 100644 --- a/src/components/article/indexNewsInfo.vue +++ b/src/components/article/indexNewsInfo.vue @@ -234,25 +234,29 @@ function getFirstTextNode(node: any): any { const content = computed(() => { const content = props.data.content; - // 未发布文章直接返回 status = 2 已发布 - if(!content || props.data.status !== 2) { - return content; - } + + return content; - // 插入文案 - const insertText = `中证参考海外资讯${dayjs(props.data.publishTime).format('MM月DD日')}援引${props.data.source}`; - const dom = new DOMParser().parseFromString(content, "text/html"); - const body = dom.querySelector("body"); - const p = body?.childNodes; - for(let i = 0; i < p.length; i++){ - const textNode = getFirstTextNode(p[i]); - console.log(textNode) - if(textNode){ - textNode.textContent = insertText + textNode.textContent; - break; - } - } - return body?.innerHTML; + // 暂时不上线文案插入功能,后续如果有需要再打开 + // // 未发布文章直接返回 status = 2 已发布 + // if(!content || props.data.status !== 2) { + // return content; + // } + + // // 插入文案 + // const insertText = `中证参考海外资讯${dayjs(props.data.publishTime).format('MM月DD日')}援引${props.data.source}`; + // const dom = new DOMParser().parseFromString(content, "text/html"); + // const body = dom.querySelector("body"); + // const p = body?.childNodes; + // for(let i = 0; i < p.length; i++){ + // const textNode = getFirstTextNode(p[i]); + // console.log(textNode) + // if(textNode){ + // textNode.textContent = insertText + textNode.textContent; + // break; + // } + // } + // return body?.innerHTML; });