diff --git a/public/static/isolatedPages/pdfExtractor/index.html b/public/static/isolatedPages/pdfExtractor/index.html index 6a573e1..6b6a6ee 100644 --- a/public/static/isolatedPages/pdfExtractor/index.html +++ b/public/static/isolatedPages/pdfExtractor/index.html @@ -13,6 +13,15 @@ border: 1px solid #ddd; margin-top: 20px; } + body { + background-color: #1a1a1a; /* 默认深色 */ + color: #ffffff; + transition: all 0.3s ease; /* 平滑切换 */ + } + body.theme-light { + background-color: #ffffff; /* 浅色模式 */ + color: #000000; + } @@ -33,6 +42,13 @@ @@ -156,7 +58,8 @@ const filterBlogs = () => { flex-direction: column; justify-content: flex-start; align-items: center; - padding: 20px; + padding-top: 20px; + gap: 20px; //margin-top: 70px; } @@ -173,7 +76,7 @@ const filterBlogs = () => { flex-wrap: wrap; /* 允许标签换行 */ gap: 10px; justify-content: center; /* 使标签居中 */ - padding: 0 200px; + max-width: 1200px; } .tags span { @@ -201,8 +104,7 @@ const filterBlogs = () => { flex-wrap: wrap; justify-content: center; gap: 20px; - width: calc(100% - 400px); - padding: 0 200px; + max-width: 1200px; } .theme-light .tags span.active { diff --git a/src/pages/Editor.vue b/src/pages/Editor.vue index 1c180e4..881dbfa 100644 --- a/src/pages/Editor.vue +++ b/src/pages/Editor.vue @@ -31,6 +31,7 @@ import {Editor, Toolbar} from '@wangeditor/editor-for-vue'; import api from "../utils/axios.js"; import swal from "../utils/sweetalert.js"; import Swal from "sweetalert2"; +import axios from "axios"; // 编辑器实例,必须用 shallowRef @@ -105,7 +106,7 @@ onBeforeUnmount(() => { editor.destroy(); }); -async function showInputPopup() { +async function titleInputWindow() { try { while (1) { const result = await Swal.fire({ @@ -140,18 +141,40 @@ async function showInputPopup() { console.error('输入弹窗出错:', error) } } +async function inputDirectSubmitURL() { + const result = await Swal.fire({ + title: '测试: 上传接口', + input: 'text', + inputLabel: '输入上传博客调用的POST接口url', + inputPlaceholder: '如"http://localhost:1234/blogs"', + showCancelButton: true, + cancelButtonText: '使用cyberURL', + confirmButtonText: '确定', + inputValidator: (value) => { + if (!value) { + return '输一下' + } + } + }) + if (!result.isConfirmed) { + return 'https://mva-cyber.club:5001/blogs'; + } + return result.value; +} // 🚀 提交博客 const submitBlog = async () => { if (!editorRef.value) return; - const title = await showInputPopup(); + const title = await titleInputWindow(); if (title === -1) { return; } const response = await swal.window('info', '允许评论吗?', '其他用户可以在你的博客下留言', '允许', '不允许'); let allowComments = response.isConfirmed; + const submitURL = await inputDirectSubmitURL(); + let content = editorRef.value.getHtml(); // 获取 HTML 内容 const images = [...imagesCache.value]; // 复制图片数组 @@ -229,19 +252,32 @@ const submitBlog = async () => { console.log(Object.fromEntries(formData.entries())); // 3️⃣ 发送请求 - api.post('/blogs', formData).then(response => { - if (response.status !== 200) { - swal.tip('error', `404'}`); - return; - } - if (response.code === 0) { - swal.window('success', `提交成功, 博客id${response.blogId || '未找到(blogId字段)'}`); - return; - } - swal.tip('error', '提交失败, code字段不为0') - }).catch((e) => { - swal.tip('error', `错误${e.message}`) - }); + + axios.post(submitURL, formData).then(response => { + response = response.data; + console.log(response) + if (response.code === 0) { + swal.window('success', '提交成功',`博客id: ${response.blogId || '未找到blogId字段'}`,'ok','好的'); + return; + } + swal.tip('error', '提交失败, code字段不为0') + }).catch((e) => { + swal.tip('error', `错误${e.message}`) + }); + + // api.post('/blogs', formData).then(response => { + // if (response.status !== 200) { + // swal.tip('error', `404'}`); + // return; + // } + // if (response.code === 0) { + // swal.window('success', `提交成功, 博客id${response.blogId || '未找到blogId字段'}`); + // return; + // } + // swal.tip('error', '提交失败, code字段不为0') + // }).catch((e) => { + // swal.tip('error', `错误${e.message}`) + // }); }; diff --git a/src/pages/demoPages/messageBoard/Board_page.vue b/src/pages/demoPages/messageBoard/Board_page.vue index a796dd6..64d618e 100644 --- a/src/pages/demoPages/messageBoard/Board_page.vue +++ b/src/pages/demoPages/messageBoard/Board_page.vue @@ -367,4 +367,7 @@ onBeforeUnmount(() => { .send-button:disabled { background-color: #9d9d9d; } +.theme-light .send-button:disabled { + background-color: #9d9d9d; + } \ No newline at end of file diff --git a/src/pages/toolPages/pdfExtractor/pdfEx_page.vue b/src/pages/toolPages/pdfExtractor/pdfEx_page.vue index 4d51a51..882f1b4 100644 --- a/src/pages/toolPages/pdfExtractor/pdfEx_page.vue +++ b/src/pages/toolPages/pdfExtractor/pdfEx_page.vue @@ -1,10 +1,44 @@