From 998f025a8d5313f94b54497bfc731ae961d52bcb Mon Sep 17 00:00:00 2001
From: ZengTao <2773468879@qq.com>
Date: 星期三, 24 七月 2024 08:29:35 +0800
Subject: [PATCH] 消息过长时,websocket分块推送消息 指定钢化改为有一炉正在出片时不允许指定钢化

---
 UI-Project/vite.config.js |   67 ++++++++++++++++++++++-----------
 1 files changed, 44 insertions(+), 23 deletions(-)

diff --git a/UI-Project/vite.config.js b/UI-Project/vite.config.js
index c5cc368..8fdf859 100644
--- a/UI-Project/vite.config.js
+++ b/UI-Project/vite.config.js
@@ -1,40 +1,61 @@
-import { fileURLToPath, URL } from 'node:url'
-
-import { defineConfig } from 'vite'
+import {fileURLToPath, URL} from 'node:url'
+import {defineConfig} from 'vite'
 import vue from '@vitejs/plugin-vue'
 import ReactivityTransform from '@vue-macros/reactivity-transform/vite'
+import AutoImport from 'unplugin-auto-import/vite'
 
 // https://vitejs.dev/config/
 export default defineConfig({
   plugins: [
     vue(),
-    ReactivityTransform()
+    ReactivityTransform(),
+    AutoImport({
+      imports: [
+        'vue-i18n',
+      ],
+      dts: './auto-imports.d.ts',
+      eslintrc: {
+        enabled: false, // 閰嶇疆鏇存柊鏃朵复鏃惰涓簍rue,
+      },
+    }),
   ],
   resolve: {
     alias: {
+      'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js',
       '@': fileURLToPath(new URL('./src', import.meta.url))
     }
   }, 
   server: {
-    port: 801,//绔彛鍙�
-    host: true,//ip鍦板潃 鎴� '0.0.0.0' 鎴� "loaclhost"
-    open: false, //鍚姩鍚庢槸鍚﹁嚜鍔ㄦ墦寮�娴忚鍣�
-    https: false, // 鏄惁寮�鍚� https
+    port: 801,
+    host: true,
+    open: false,
+    https: false,
     proxy: {
-      '^/api': {
-        target: 'localhost:8080/mesModuleTools', //鐩爣婧愶紝鐩爣鏈嶅姟鍣紝鐪熷疄璇锋眰鍦板潃
-        changeOrigin: true, //鏀寔璺ㄥ煙
-        rewrite: (path) => path.replace(/^\/api/, "/mesModuleTools"), //閲嶅啓鐪熷疄璺緞,鏇挎崲/api
-      //   pathRewrite: {
-      //     '^/api': ''
-      // }
-        // rewrite: (path) => path.replace(/^\/api/, "/mesModuleTools"), //閲嶅啓鐪熷疄璺緞,鏇挎崲/api
-      },
-      '/api2': {
-        target: 'localhost:8080/mesModuleTools',
+      '/api': {
+        target: 'http://127.0.0.1:88/',
         changeOrigin: true,
-        rewrite: (path) => path.replace(/^\/api2/, ""),
+        rewrite: (path) => path.replace(/^\/api/, '/'),
       },
-    }
-  }
-})
+      // '/api2': {
+      //   target: 'http://localhost:8085/mesModuleTools',
+      //   changeOrigin: true,
+      //   pathRewrite: {
+      //     '^/api2': '',
+      //   },
+      // },
+    },
+  },
+  configureServer: ({ middlewares }) => {
+    middlewares.use(
+      '/mesModuleTools',
+      createProxyMiddleware({
+        target: 'ws://localhost:8081',
+        ws: true,
+        changeOrigin: true,
+        pathRewrite: {
+          '^/mesModuleTools': '',
+        },
+      })
+    );
+  },
+});

--
Gitblit v1.8.0