纳入范围: - backend/ Spring Boot 多模块后端(iot-common/device/rule/data/alarm/auth) - frontend/admin/ Vue3 + Element Plus 管理后台 - Android/ 涂鸦原生 APP (com.xhai.iot) - backend/sql/ Flyway 风格迁移脚本(V2~V21) - docs/ 对接文档与设计文档 排除范围: - 构建产物: node_modules/ target/ build/ dist/ .gradle/ - 签名密钥: *.jks *.keystore (严禁入库) - 本机配置: Android/local.properties - 运行日志: logs/ *.log - AI 协作本地数据 .codebuddy/ 与第三方 demo tuya-demo/ .gitattributes 统一以 LF 存储, Windows 批处理保留 CRLF
122 lines
3.2 KiB
TypeScript
122 lines
3.2 KiB
TypeScript
import { defineConfig } from 'vite'
|
||
import vue from '@vitejs/plugin-vue'
|
||
import { resolve } from 'path'
|
||
import AutoImport from 'unplugin-auto-import/vite'
|
||
import Components from 'unplugin-vue-components/vite'
|
||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
||
import ElementPlus from 'unplugin-element-plus/vite'
|
||
|
||
// https://vitejs.dev/config/
|
||
export default defineConfig({
|
||
plugins: [
|
||
vue(),
|
||
AutoImport({
|
||
resolvers: [ElementPlusResolver()],
|
||
imports: ['vue', 'vue-router', 'pinia'],
|
||
dts: 'src/auto-imports.d.ts'
|
||
}),
|
||
Components({
|
||
resolvers: [ElementPlusResolver()],
|
||
dts: 'src/components.d.ts'
|
||
}),
|
||
ElementPlus({})
|
||
],
|
||
resolve: {
|
||
alias: {
|
||
'@': resolve(__dirname, 'src')
|
||
}
|
||
},
|
||
optimizeDeps: {
|
||
// 依赖预优化缓存放到项目外(f:/work/iotsaas/.vite-cache),
|
||
// 避免 Vite 清理 node_modules/.vite 触发 CodeBuddy 文件删除防护导致 dev server 崩溃
|
||
cacheDir: resolve(__dirname, '../../.vite-cache')
|
||
},
|
||
server: {
|
||
port: 3000,
|
||
host: true,
|
||
proxy: {
|
||
// 设备服务 + 认证 + 系统管理 + 操作日志 (9081)
|
||
'/api/v1/devices': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/auth': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/device-groups': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/users': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/members': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/roles': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/logs': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/admin/platforms': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/admin/apps': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
// 产品管理 / 物模型 / 固件 OTA (9081)
|
||
'/api/v1/products': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/ota-tasks': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/firmwares': {
|
||
target: 'http://localhost:9081',
|
||
changeOrigin: true
|
||
},
|
||
// 数据服务 (9082)
|
||
'/api/v1/data': {
|
||
target: 'http://localhost:9082',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/device-data': {
|
||
target: 'http://localhost:9082',
|
||
changeOrigin: true
|
||
},
|
||
// 规则服务 (9083)
|
||
'/api/v1/rules': {
|
||
target: 'http://localhost:9083',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/linkage-rules': {
|
||
target: 'http://localhost:9083',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/scenes': {
|
||
target: 'http://localhost:9083',
|
||
changeOrigin: true
|
||
},
|
||
// 告警服务 (9084)
|
||
'/api/v1/alarms': {
|
||
target: 'http://localhost:9084',
|
||
changeOrigin: true
|
||
},
|
||
'/api/v1/alarm-rules': {
|
||
target: 'http://localhost:9084',
|
||
changeOrigin: true
|
||
}
|
||
}
|
||
}
|
||
})
|