From 2bc8822f600174939636db876633e741b0e8f8a1 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Sun, 27 Jul 2025 01:15:28 +0800 Subject: [PATCH] temp --- official/astro.config.mjs | 2 +- official/src/apps/index/App.tsx | 148 ++++++------------ official/src/apps/index/Editor.tsx | 107 +++++++++++++ official/src/apps/index/modules/get-origin.ts | 7 + official/src/pages/editor.astro | 21 +++ 5 files changed, 184 insertions(+), 101 deletions(-) create mode 100644 official/src/apps/index/Editor.tsx create mode 100644 official/src/apps/index/modules/get-origin.ts create mode 100644 official/src/pages/editor.astro diff --git a/official/astro.config.mjs b/official/astro.config.mjs index 7f6a9af..ff3abff 100644 --- a/official/astro.config.mjs +++ b/official/astro.config.mjs @@ -25,7 +25,7 @@ export default defineConfig({ // ... site: 'https://www.kevisual.cn/', // base: isDev ? undefined : pkgs.basename, - base: './', + base: isDev ? undefined : './', integrations: [ mdx(), react(), // diff --git a/official/src/apps/index/App.tsx b/official/src/apps/index/App.tsx index b6b5e6c..4205c29 100644 --- a/official/src/apps/index/App.tsx +++ b/official/src/apps/index/App.tsx @@ -1,54 +1,21 @@ import { Mail, Phone, MapPin, Book, Globe, Brain, Save } from 'lucide-react'; -import { chain, TextEditor } from './components/TextEditor'; -import { toast, ToastContainer } from 'react-toastify'; +import { ToastContainer } from 'react-toastify'; import { Provider } from './Provider'; -// @ts-ignore import Logo from './assets/logo-1.png'; import { useState } from 'react'; -import { CodeDescModal } from './modules/CodeDescModal'; -import { query } from './modules/query.ts'; -import { toastSuccess, toastWeChat } from './modules/RedirectSuccess.tsx'; +import { toastWeChat } from './modules/RedirectSuccess.tsx'; import { WeChat } from './components/Icon.tsx'; -const getOrigin = () => { - let origin = window.location.origin; - if (origin.includes('www.kevisual.cn')) { - origin = origin.replace('www.kevisual.cn', 'kevisual.cn'); - } - return origin; +import { getOrigin } from './modules/get-origin.ts'; + +export const openEditor = () => { + window.open('./editor'); }; export const Main = () => { - const [showPreview, setShowPreview] = useState(false); - const [html, setHtml] = useState(''); - const [open, setOpen] = useState(false); - const [resultUrl, setResultUrl] = useState(''); const [url] = useState('https://kevisual.cn'); - const onSubmit = async (values: { title: string; description: string }) => { - setResultUrl(''); - const uploadData = { - title: values?.title, - description: values?.description, - content: chain.getContent(), - }; - const res = await query.post({ - path: 'app', - key: 'public-upload-html', - data: uploadData, - }); - if (res.code === 200) { - const url = res.data?.url; - if (url) { - let origin = getOrigin(); - const newUrl = new URL(url, origin); - // toast.success('创建成功, 访问地址' + newUrl.toString(), { autoClose: 3000 }); - toastSuccess(newUrl.toString()); - setResultUrl(newUrl.toString()); - } - } - }; return (
{/* Hero Section */} -
+
-
-
-
- - -
-
- +
+
+

网页部署平台

+

+ Kevisual设计助手提供强大的网页部署平台,让您轻松管理自己的博客和自定义网页。无论是个人博客、AI生成的网页,还是专业项目,都能通过我们的平台进行高效管理。 +

+
+
+

功能亮点

+
    +
  • 类似图床的文件管理系统,高效整理各类资源
  • +
  • 一键创建、删除和管理多个站点
  • +
  • 支持自定义域名,打造专属网络形象
  • +
  • 权限控制系统,可设置为仅自己可访问或公开共享
  • +
+
+
+

使用场景

+
    +
  • 个人博客与作品集展示
  • +
  • + 临时网页快速部署 +
  • +
  • AI生成内容的发布与管理
  • +
  • 小型项目的在线展示
  • +
+
+
+ - {showPreview && ( -
-