chore: 并入 iotlcm-admin-ui 历史到 admin-ui/(原提交 f305eab)

This commit is contained in:
MiFaZhan
2026-11-02 13:27:59 +08:00
1629 changed files with 189934 additions and 0 deletions
@@ -0,0 +1,54 @@
import type { DefineConfig } from '@vben/vite-config/src/typing';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
import { defineConfig } from '@vben/vite-config';
import { apiTypeGeneratorPlugin } from './plugins/api-type-generator';
const config: DefineConfig = async () => {
const proxyTarget =
process.env.VITE_DEV_PROXY_TARGET || 'http://localhost:8008';
return {
application: {},
vite: {
plugins: [
// 生成API类型文件
apiTypeGeneratorPlugin({
apiRoot: fileURLToPath(new URL('src/api', import.meta.url)),
}) as any,
],
server: {
allowedHosts: ['www.test.com'],
proxy: {
// 拉整个API文件
'/api.json': {
changeOrigin: true,
target: proxyTarget,
// target: 'http://iotlcm.example.com:8008', // 生产环境
},
// 正常API代理
'/api': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
target: `${proxyTarget}/api/v1`,
// target: 'http://iotlcm.example.com:8008/api/v1', // 生产环境
ws: true,
},
// 文件上传代理
'/upload': {
changeOrigin: true,
rewrite: (path) => path.replace(/^\/upload/, ''),
target: `${proxyTarget}/upload`,
// target: 'http://iotlcm.example.com:8008/upload', // 生产环境
ws: true,
},
},
},
},
};
};
export default defineConfig(config) as import('vite').UserConfigExport;