Merge pull request #193 from HansYeoh/allow-all-domains

Modify to allow access from all domains
This commit is contained in:
Jianwu Huang
2025-10-18 09:59:58 +08:00
committed by GitHub

View File

@@ -8,7 +8,7 @@ export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd() + '/../') const env = loadEnv(mode, process.cwd() + '/../')
const apiBaseUrl = env.VITE_API_BASE_URL || 'http://localhost:8000' const apiBaseUrl = env.VITE_API_BASE_URL || 'http://localhost:8000'
const port = env.VITE_FRONTEND_PORT || 3015 const port = parseInt(env.VITE_FRONTEND_PORT || '3015', 10)
return { return {
base: './', base: './',
@@ -21,6 +21,7 @@ export default defineConfig(({ mode }) => {
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
port: port, port: port,
allowedHosts: true, // 允许任意域名访问
proxy: { proxy: {
'/api': { '/api': {
target: apiBaseUrl, target: apiBaseUrl,