|
@@ -5,19 +5,19 @@
|
|
|
:model="queryParams"
|
|
|
ref="queryFormRef"
|
|
|
:inline="true"
|
|
|
- label-width="90px"
|
|
|
+ label-width="110px"
|
|
|
>
|
|
|
- <el-form-item label="url提取内容" prop="urls">
|
|
|
+ <el-form-item label="微信公众号链接" prop="urls">
|
|
|
<el-input
|
|
|
v-model="queryParams.urls"
|
|
|
- class="!w-60vw"
|
|
|
+ class="!w-50vw"
|
|
|
type="textarea"
|
|
|
:rows="2"
|
|
|
placeholder="请输入需要提取的页面,多个页面请用 ',' 隔开"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button type="primary" plain :loading="loading" @click="handleExecute">执行</el-button>
|
|
|
+ <el-button type="primary" plain :loading="loading" @click="handleAnalysis">解析</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</ContentWrap>
|
|
@@ -29,14 +29,15 @@
|
|
|
<template #header>
|
|
|
<div class="flex items-center justify-between">
|
|
|
<el-text class="flex-1" truncated>{{ content.url }}</el-text>
|
|
|
- <div class="!w-40px">
|
|
|
+ <!-- <div class="!w-40px">
|
|
|
<Icon icon="ep:view" size="25" class="ml-10px cursor-pointer" color="#409eff" @click="showPage(content)" />
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class="overflow-y-auto !h-360px" v-if="content.data">
|
|
|
<pre>{{ content.data }}</pre>
|
|
|
</div>
|
|
|
+ <el-button type="primary" plain class="mt-10px" @click="showPage(content)">预览</el-button>
|
|
|
<el-button type="primary" plain class="mt-10px" @click="handleConvert(content)">转换为markdown格式</el-button>
|
|
|
</el-card>
|
|
|
</el-col>
|
|
@@ -170,29 +171,29 @@ const showPage = (res) => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-// 执行
|
|
|
-const handleExecute = async () => {
|
|
|
+// 解析
|
|
|
+const handleAnalysis = async () => {
|
|
|
if (!queryParams.urls) return
|
|
|
contents.value = []
|
|
|
loading.value = true
|
|
|
- try {
|
|
|
- const urlArr = queryParams.urls.split(',').map(url => url.trim()).filter(Boolean)
|
|
|
- const isWeChatUrl = urlArr.every(url => url.includes('https://mp.weixin.qq.com'))
|
|
|
- if (!isWeChatUrl) {
|
|
|
- message.warning('请输入微信公众文章链接')
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- axios.post('/process-urls', { urlArr }).then(res => {
|
|
|
- console.log(res, '解析内容')
|
|
|
- contents.value = res?.data?.contents ?? []
|
|
|
- })
|
|
|
-
|
|
|
- } catch (e) {
|
|
|
- message.error('获取失败', e)
|
|
|
- } finally {
|
|
|
- loading.value = false
|
|
|
+
|
|
|
+ const urlArr = queryParams.urls.split(',').map(url => url.trim()).filter(Boolean)
|
|
|
+
|
|
|
+ const isWeChatUrl = urlArr.every(url => url.includes('https://mp.weixin.qq.com'))
|
|
|
+ if (!isWeChatUrl) {
|
|
|
+ message.warning('请输入微信公众文章链接')
|
|
|
+ return
|
|
|
}
|
|
|
+
|
|
|
+ axios.post('/process-urls', { urlArr }).then(res => {
|
|
|
+ console.log(res, '解析内容')
|
|
|
+ contents.value = res?.data?.contents ?? []
|
|
|
+ }).catch(err => {
|
|
|
+ console.log(err, 'error');
|
|
|
+ message.error(err.message)
|
|
|
+ }).finally(_ => {
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
}
|
|
|
</script>
|
|
|
|