chore: 优化 Vite 热更新配置,支持局域网动态 IP 访问并修复 wss 跨域报错
This commit is contained in:
@ -18,6 +18,10 @@ export default defineConfig({
|
||||
host: '0.0.0.0',
|
||||
port: 5173,
|
||||
https: true, // ★ [新增] 强制开启 HTTPS,否则浏览器会拦截摄像头
|
||||
hmr: {
|
||||
protocol: 'wss',
|
||||
clientPort: 5173
|
||||
},
|
||||
proxy: {
|
||||
// 拦截所有以 /api 开头的请求
|
||||
'/api': {
|
||||
|
||||
Reference in New Issue
Block a user