品牌升级: - 全站品牌从"知冶"更名为"战知" - 更换 favicon、侧边栏 logo、登录页 logo - 更新登录页标语和首页欢迎语 应用广场重构: - 从后端数据库驱动改为前端静态配置,按分类 tab 展示 - 新增工具卡片 UI,支持 logo 图片和 emoji 图标 新增工具部署: - Stirling PDF (端口18080) - PDF 处理工具箱 - Excalidraw (端口18081) - 手绘风格白板,集成 AI 绘图 - TrWebOCR (端口18083) - 中文离线 OCR - LibreTranslate (端口18084) - 中英翻译引擎 - PPTist (端口18085) - 在线 PPT 编辑器 - PPTist AI 后端 (端口18086) - 对接 deepseek-v3 生成大纲/PPT/写作 - Excalidraw AI 代理 (端口18082) - 对接 deepseek-v3 生成 Mermaid 图 其他: - 智能场景仅保留"选题推荐" - vite 代理配置增加 /pdf/ 和 /draw/ 路由 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
60 lines
1.5 KiB
TypeScript
60 lines
1.5 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
||
|
||
import { defineConfig,loadEnv } from 'vite'
|
||
import type { PluginOption } from 'vite'
|
||
import vue from '@vitejs/plugin-vue'
|
||
import vueDevTools from 'vite-plugin-vue-devtools'
|
||
import AutoImport from 'unplugin-auto-import/vite'
|
||
import Components from 'unplugin-vue-components/vite'
|
||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||
|
||
function setupPlugins(env: ImportMetaEnv): PluginOption[] {
|
||
return [
|
||
vue(),
|
||
vueDevTools(),
|
||
// topLevelAwait(),
|
||
AutoImport({
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
Components({
|
||
resolvers: [ElementPlusResolver()],
|
||
}),
|
||
]
|
||
}
|
||
|
||
export default defineConfig((env) => {
|
||
const viteEnv = loadEnv(env.mode, process.cwd()) as unknown as ImportMetaEnv
|
||
return {
|
||
base: viteEnv.VITE_GLOB_FRONT_CTX,
|
||
plugins: setupPlugins(viteEnv),
|
||
server: {
|
||
host: '0.0.0.0',
|
||
port: viteEnv.VITE_GLOB_FRONT_PORT,
|
||
open: false,
|
||
proxy: {
|
||
[viteEnv.VITE_GLOB_API_CTX]: {
|
||
target: viteEnv.VITE_GLOB_API_DEV_IP,
|
||
changeOrigin: true,
|
||
},
|
||
// 工具服务通过 Nginx(:18000) 反代,sub_filter 处理子资源路径
|
||
'/pdf/': {
|
||
target: 'http://localhost:18000',
|
||
changeOrigin: true,
|
||
},
|
||
'/draw/': {
|
||
target: 'http://localhost:18000',
|
||
changeOrigin: true,
|
||
},
|
||
},
|
||
},
|
||
build: {
|
||
target: 'esnext',
|
||
},
|
||
resolve: {
|
||
alias: {
|
||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||
},
|
||
},
|
||
}
|
||
})
|