feat: add vditor locally

This commit is contained in:
merlin
2025-11-12 14:39:23 +08:00
parent 16e8fd2d65
commit 4e21c62e26
532 changed files with 43947 additions and 38 deletions

View File

@@ -12,14 +12,13 @@ export default defineConfig({
server: {
proxy: {
"/api": {
target: "http://localhost:8080", // 后端服务器地址
target: "http://localhost:8080",
changeOrigin: true, // 允许跨域
rewrite: (path) => path.replace(/^\/api/, ""), // 重写路径,去掉 /api 前缀
rewrite: (path) => path.replace(/^\/api/, ""),
},
"/proxy": {
target: "http://localhost:3000", // 代理服务器的地址
changeOrigin: true, // 必须设置为 true才能避免跨域问题
// rewrite: (path) => path.replace(/^\/proxy/, ''), // 重写路径,去掉 /api 前缀
target: "http://localhost:3000",
changeOrigin: true,
},
"/online": {
target: "ws://localhost:8080",
@@ -31,6 +30,12 @@ export default defineConfig({
changeOrigin: true,
ws: true,
},
"/vditor": {
target: "http://localhost:5173",
rewrite: (path) => {
return path.replace(/^\/vditor/, "/node_modules/vditor");
},
},
},
host: "0.0.0.0",
},