- 新增 localServerApi.ts: 本地代理 API (通道列表/连通测试/实时流) - 新增 localCameraServer store: 管理本机多端口连接 - 新增 CameraPreviewDialog: 摄像头预览弹窗 (RTSP→MJPEG, 内外网回退) - 新增 CameraPlayer: 海康SDK播放器组件(备用) - 录像服务器列表增加连通测试按钮(先内网后公网) - 摄像头表单选择服务器后自动拉取通道列表 - 通道选中自动填充设备信息(IP/端口/型号/序列号) - camera API create/update 入参扩充(ip/port/model/serial_number/stream_type) - custom_name 改为必填 - vite.config.ts 增加 /ISAPI 代理转发 - public/hikvision/ 海康Web SDK静态资源
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
import path from 'path'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
createSvgIconsPlugin({
|
|
// Specify the icon folder to be cached
|
|
iconDirs: [path.resolve(process.cwd(), 'src/icons/svg')],
|
|
// Specify symbolId format
|
|
symbolId: 'icon-[dir]-[name]',
|
|
}),
|
|
],
|
|
server: {
|
|
port: 5174,
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/dev-api': {
|
|
target: 'http://localhost:9528', // Assuming Vue 2 backend is running here, user can change
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/dev-api/, '')
|
|
},
|
|
'/dl-api': {
|
|
target: 'https://dl.wms.gztbyc.com',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/dl-api/, '')
|
|
},
|
|
// 海康 SDK ISAPI 请求 → 本地代理 → NVR
|
|
'/ISAPI': {
|
|
target: 'http://localhost:17311',
|
|
changeOrigin: true
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
},
|
|
},
|
|
})
|