Files
memory_block_upload_web/vite.config.js
2025-10-24 18:56:21 +08:00

29 lines
834 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
// https://vite.dev/config/
export default defineConfig({
server: {
host: true,
port: 5173,
proxy: {
'/kiosk-upload': {
// 将此替换为你的后端 baseUrl,例如 'https://api.example.com'
target: 'https://bmapi.tttzai.com',
changeOrigin: true, // 修改 Host 头为 target,避免后端基于 Host 的限制
secure: false, // 如果是自签名 HTTPS,在开发环境禁用证书校验
// 后端路径不同才需要 rewrite,例如后端路径是 '/api/upload'
// rewrite: (path) => path.replace(/^\/kiosk-upload/, '/api')
},
},
},
plugins: [vue()],
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
})