2026-03-27 17:37:27 +08:00
|
|
|
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
|
|
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
import AutoImport from 'unplugin-auto-import/vite'
|
|
|
|
|
import Components from 'unplugin-vue-components/vite'
|
|
|
|
|
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
|
|
|
|
import legacy from '@vitejs/plugin-legacy'
|
|
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
base: './',
|
|
|
|
|
publicPath: './',
|
|
|
|
|
plugins: [
|
|
|
|
|
vue(),
|
|
|
|
|
AutoImport({
|
|
|
|
|
resolvers: [ElementPlusResolver()],
|
|
|
|
|
}),
|
|
|
|
|
Components({
|
|
|
|
|
resolvers: [ElementPlusResolver()],
|
|
|
|
|
}),
|
|
|
|
|
legacy({
|
|
|
|
|
target: ['ie>=11'],
|
|
|
|
|
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
|
|
|
|
|
}),
|
|
|
|
|
],
|
|
|
|
|
resolve: {
|
|
|
|
|
alias: {
|
|
|
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
server: {
|
|
|
|
|
//用来配置跨域
|
|
|
|
|
host: '127.0.0.1',
|
|
|
|
|
port: 7003,
|
|
|
|
|
proxy: {
|
|
|
|
|
'/authentication': {
|
|
|
|
|
target: 'http://127.0.0.1:8011',//鉴权服务器地址
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/authentication/, '')
|
|
|
|
|
},
|
|
|
|
|
'/bdShortMessage': {
|
|
|
|
|
target: 'http://127.0.0.1:8090',//资源服务器地址
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/bdShortMessage/, '')
|
|
|
|
|
},
|
|
|
|
|
'/bdrdWebSocket': {
|
|
|
|
|
target: 'http://127.0.0.1:8010',//webSocket服务器地址
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/bdrdWebSocket/, '')
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-04-20 12:30:44 +08:00
|
|
|
});
|