From 425386f6f403d8dee0db2632ad3598039d833f4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 26 Jul 2024 16:06:17 +0800 Subject: [PATCH 01/20] =?UTF-8?q?add=20=E5=A2=9E=E5=8A=A0=20sse=20?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 2 ++ src/utils/sse.ts | 48 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 src/utils/sse.ts diff --git a/src/layout/index.vue b/src/layout/index.vue index 29fb5ff..e7bec82 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -27,6 +27,7 @@ import { AppMain, Navbar, Settings, TagsView } from './components'; import useAppStore from '@/store/modules/app'; import useSettingsStore from '@/store/modules/settings'; import { initWebSocket } from '@/utils/websocket'; +import { initSSE } from "@/utils/sse"; const settingsStore = useSettingsStore(); const theme = computed(() => settingsStore.theme); @@ -69,6 +70,7 @@ onMounted(() => { onMounted(() => { let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://'; initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + '/resource/websocket'); + initSSE(import.meta.env.VITE_APP_BASE_API + '/sse') }); const handleClickOutside = () => { diff --git a/src/utils/sse.ts b/src/utils/sse.ts new file mode 100644 index 0000000..7db4aa7 --- /dev/null +++ b/src/utils/sse.ts @@ -0,0 +1,48 @@ +import { getToken } from '@/utils/auth'; +import { ElNotification } from 'element-plus'; +import useNoticeStore from '@/store/modules/notice'; + +let message = ''; + +// 初始化 +export const initSSE = (url: any) => { + if (import.meta.env.VITE_APP_WEBSOCKET === 'false') { + return; + } + url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID + const { + data, + error + } = useEventSource(url, [], { + autoReconnect: { + retries: 10, + delay: 3000, + onFailed() { + console.log('Failed to connect after 10 retries') + }, + } + }); + + watch(error, () => { + console.log('SSE connection error:', error.value) + error.value = null; + }); + + watch(data, () => { + if (!data.value) return; + useNoticeStore().addNotice({ + message: data.value, + read: false, + time: new Date().toLocaleString() + }); + ElNotification({ + title: '消息', + message: data.value, + type: 'success', + duration: 3000 + }); + data.value = null; + }); +}; + + From adadfcf8cb028d512a7a06cf7a280831a11fc295 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 26 Jul 2024 16:24:40 +0800 Subject: [PATCH 02/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E9=BB=98=E8=AE=A4=E6=8E=A8=E9=80=81=E4=BD=BF=E7=94=A8?= =?UTF-8?q?SSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 ++-- .env.production | 4 ++-- src/layout/index.vue | 5 ++++- src/utils/sse.ts | 3 --- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.env.development b/.env.development index 52553ff..05d6778 100644 --- a/.env.development +++ b/.env.development @@ -28,5 +28,5 @@ VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3C # 客户端id VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' -# websocket 开关 -VITE_APP_WEBSOCKET = true +# websocket 开关 默认使用sse推送 +VITE_APP_WEBSOCKET = false diff --git a/.env.production b/.env.production index bf9e644..c6b1f85 100644 --- a/.env.production +++ b/.env.production @@ -31,5 +31,5 @@ VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3C # 客户端id VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' -# websocket 开关 -VITE_APP_WEBSOCKET = true +# websocket 开关 默认使用sse推送 +VITE_APP_WEBSOCKET = false diff --git a/src/layout/index.vue b/src/layout/index.vue index e7bec82..0919aad 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -70,7 +70,10 @@ onMounted(() => { onMounted(() => { let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://'; initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + '/resource/websocket'); - initSSE(import.meta.env.VITE_APP_BASE_API + '/sse') +}); + +onMounted(() => { + initSSE(import.meta.env.VITE_APP_BASE_API + '/resource/sse') }); const handleClickOutside = () => { diff --git a/src/utils/sse.ts b/src/utils/sse.ts index 7db4aa7..a08f282 100644 --- a/src/utils/sse.ts +++ b/src/utils/sse.ts @@ -6,9 +6,6 @@ let message = ''; // 初始化 export const initSSE = (url: any) => { - if (import.meta.env.VITE_APP_WEBSOCKET === 'false') { - return; - } url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID const { data, From e07c0b2b3aaa94dbcc72e13bfb31952abef1d3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 27 Jul 2024 14:08:07 +0800 Subject: [PATCH 03/20] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=90=8C=E6=AD=A5=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/gen/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue index 2618a20..1b7cd55 100644 --- a/src/views/tool/gen/index.vue +++ b/src/views/tool/gen/index.vue @@ -202,7 +202,7 @@ const handleGenTable = async (row?: TableVO) => { /** 同步数据库操作 */ const handleSynchDb = async (row: TableVO) => { const tableId = row.tableId; - await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?'); + await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?').catch(() => {}); await synchDb(tableId); proxy?.$modal.msgSuccess('同步成功'); }; From 6a83ed2aad30a13a32c624a59ae27911dfb6911a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 27 Jul 2024 14:15:19 +0800 Subject: [PATCH 04/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90=E5=99=A8=E7=BC=96=E8=BE=91=E9=A1=B5?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E7=BC=93=E5=AD=98=20=E9=98=B2=E6=AD=A2?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=90=8E=E9=A1=B5=E9=9D=A2=E4=B8=8D=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router/index.ts b/src/router/index.ts index 438708f..86e0092 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -159,7 +159,7 @@ export const dynamicRoutes: RouteRecordRaw[] = [ path: 'index/:tableId(\\d+)', component: () => import('@/views/tool/gen/editTable.vue'), name: 'GenEdit', - meta: { title: '修改生成配置', activeMenu: '/tool/gen', icon: '' } + meta: { title: '修改生成配置', activeMenu: '/tool/gen', icon: '', noCache: true } } ] }, From 358f11a0a3536391348e5466b8f8a000d3bd22e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 27 Jul 2024 15:07:33 +0800 Subject: [PATCH 05/20] =?UTF-8?q?reset=20=E5=9B=9E=E6=BB=9A=20=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/gen/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/tool/gen/index.vue b/src/views/tool/gen/index.vue index 1b7cd55..2618a20 100644 --- a/src/views/tool/gen/index.vue +++ b/src/views/tool/gen/index.vue @@ -202,7 +202,7 @@ const handleGenTable = async (row?: TableVO) => { /** 同步数据库操作 */ const handleSynchDb = async (row: TableVO) => { const tableId = row.tableId; - await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?').catch(() => {}); + await proxy?.$modal.confirm('确认要强制同步"' + row.tableName + '"表结构吗?'); await synchDb(tableId); proxy?.$modal.msgSuccess('同步成功'); }; From 6c49b47344d4ccabc05f5ece7bb147bcc3035f10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 27 Jul 2024 15:08:13 +0800 Subject: [PATCH 06/20] update element-plus 2.7.5 => 2.7.8 update vue 3.4.25 => 3.4.34 update vite 5.2.10 => 5.2.12 --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index f1c8084..29cb290 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "diagram-js": "12.3.0", "didi": "9.0.2", "echarts": "5.5.0", - "element-plus": "2.7.5", + "element-plus": "2.7.8", "file-saver": "2.0.5", "fuse.js": "7.0.0", "highlight.js": "11.9.0", @@ -40,7 +40,7 @@ "nprogress": "0.2.0", "pinia": "2.1.7", "screenfull": "6.0.2", - "vue": "3.4.25", + "vue": "3.4.34", "vue-cropper": "1.1.1", "vue-i18n": "9.10.2", "vue-router": "4.3.2", @@ -81,7 +81,7 @@ "unplugin-icons": "0.18.5", "unplugin-vue-components": "0.26.0", "unplugin-vue-setup-extend-plus": "1.0.1", - "vite": "5.2.10", + "vite": "5.2.12", "vite-plugin-compression": "0.5.1", "vite-plugin-svg-icons": "2.0.1", "vitest": "1.5.0", From e5e43fe024becfb0b5322c7cad0362fcc3b98e81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Sat, 27 Jul 2024 22:10:22 +0800 Subject: [PATCH 07/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=97=A0=E7=94=A8=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/workflow/leave/index.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/workflow/leave/index.vue b/src/views/workflow/leave/index.vue index d9c50c4..f413136 100644 --- a/src/views/workflow/leave/index.vue +++ b/src/views/workflow/leave/index.vue @@ -176,7 +176,6 @@ const handleSelectionChange = (selection: LeaveVO[]) => { /** 新增按钮操作 */ const handleAdd = () => { proxy.$tab.closePage(proxy.$route); - proxy.$router.push(`/workflow/leaveEdit/index/add/add`); proxy.$router.push({ path: `/workflow/leaveEdit/index`, query: { From 1465a27a6eba0677ddbd0d137669bbf6e3c6faf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 29 Jul 2024 12:29:16 +0800 Subject: [PATCH 08/20] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E7=99=BB?= =?UTF-8?q?=E5=87=BA=E5=90=8E=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=20sse?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/login.ts b/src/api/login.ts index b6955de..c7c291e 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -51,6 +51,10 @@ export function register(data: any) { * 注销 */ export function logout() { + request({ + url: '/resource/sse/close', + method: 'get' + }); return request({ url: '/auth/logout', method: 'post' From f5a5aaa255d2dfd63c5cf68ee3ff6657240fa3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 29 Jul 2024 12:32:05 +0800 Subject: [PATCH 09/20] =?UTF-8?q?reset=20=E5=9B=9E=E6=BB=9A=20=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E4=BF=AE=E6=94=B9=20=E9=87=87=E7=94=A8=E5=85=B6?= =?UTF-8?q?=E4=BB=96=E6=96=B9=E6=A1=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/api/login.ts b/src/api/login.ts index c7c291e..b6955de 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -51,10 +51,6 @@ export function register(data: any) { * 注销 */ export function logout() { - request({ - url: '/resource/sse/close', - method: 'get' - }); return request({ url: '/auth/logout', method: 'post' From d58a75996e534b134a1d4b958d0934efec21c6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 29 Jul 2024 12:34:32 +0800 Subject: [PATCH 10/20] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E7=99=BB?= =?UTF-8?q?=E5=87=BA=E5=90=8E=E9=87=8D=E6=96=B0=E7=99=BB=E5=BD=95=20sse?= =?UTF-8?q?=E6=8E=A8=E9=80=81=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/login.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/login.ts b/src/api/login.ts index b6955de..c7c291e 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -51,6 +51,10 @@ export function register(data: any) { * 注销 */ export function logout() { + request({ + url: '/resource/sse/close', + method: 'get' + }); return request({ url: '/auth/logout', method: 'post' From 964db2dfce990fe920f014c62a0894bef8bbee11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 29 Jul 2024 15:02:41 +0800 Subject: [PATCH 11/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20vueuse=20=E9=87=8D=E6=9E=84=20websocket=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/websocket.ts | 148 +++++++++++------------------------------ 1 file changed, 40 insertions(+), 108 deletions(-) diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts index d4dd8a8..37942d8 100644 --- a/src/utils/websocket.ts +++ b/src/utils/websocket.ts @@ -22,118 +22,50 @@ import { getToken } from '@/utils/auth'; import { ElNotification } from 'element-plus'; import useNoticeStore from '@/store/modules/notice'; -let socketUrl: any = ''; // socket地址 -let websocket: any = null; // websocket 实例 -let heartTime: any = null; // 心跳定时器实例 -let socketHeart = 0 as number; // 心跳次数 -const HeartTimeOut = 10000; // 心跳超时时间 10000 = 10s -let socketError = 0 as number; // 错误次数 - // 初始化socket export const initWebSocket = (url: any) => { if (import.meta.env.VITE_APP_WEBSOCKET === 'false') { return; } - socketUrl = url; - // 初始化 websocket - websocket = new WebSocket(url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID); - websocketonopen(); - websocketonmessage(); - websocketonerror(); - websocketclose(); - sendSocketHeart(); - return websocket; -}; - -// socket 连接成功 -export const websocketonopen = () => { - websocket.onopen = function () { - console.log('连接 websocket 成功'); - resetHeart(); - }; -}; - -// socket 连接失败 -export const websocketonerror = () => { - websocket.onerror = function (e: any) { - console.log('连接 websocket 失败', e); - }; -}; - -// socket 断开链接 -export const websocketclose = () => { - websocket.onclose = function (e: any) { - console.log('断开连接', e); - }; -}; - -// socket 重置心跳 -export const resetHeart = () => { - socketHeart = 0; - socketError = 0; - clearInterval(heartTime); - sendSocketHeart(); -}; - -// socket心跳发送 -export const sendSocketHeart = () => { - heartTime = setInterval(() => { - // 如果连接正常则发送心跳 - if (websocket.readyState == 1) { - // if (socketHeart <= 30) { - websocket.send( - JSON.stringify({ - type: 'ping' - }) - ); - socketHeart = socketHeart + 1; - } else { - // 重连 - reconnect(); + url = url + '?Authorization=Bearer ' + getToken() + '&clientid=' + import.meta.env.VITE_APP_CLIENT_ID + useWebSocket(url, { + autoReconnect: { + // 重连最大次数 + retries: 3, + // 重连间隔 + delay: 1000, + onFailed() { + console.log('websocket重连失败'); + }, + }, + heartbeat: { + message: JSON.stringify({type: 'ping'}), + // 发送心跳的间隔 + interval: 10000, + // 接收到心跳response的超时时间 + pongTimeout: 2000, + }, + onConnected() { + console.log('websocket已经连接'); + }, + onDisconnected() { + console.log('websocket已经断开'); + }, + onMessage: (_, e) => { + if (e.data.indexOf('ping') > 0) { + return; + } + useNoticeStore().addNotice({ + message: e.data, + read: false, + time: new Date().toLocaleString() + }); + ElNotification({ + title: '消息', + message: e.data, + type: 'success', + duration: 3000 + }); } - }, HeartTimeOut); -}; - -// socket重连 -export const reconnect = () => { - if (socketError <= 2) { - clearInterval(heartTime); - initWebSocket(socketUrl); - socketError = socketError + 1; - // eslint-disable-next-line prettier/prettier - console.log('socket重连', socketError); - } else { - // eslint-disable-next-line prettier/prettier - console.log('重试次数已用完'); - clearInterval(heartTime); - } -}; - -// socket 发送数据 -export const sendMsg = (data: any) => { - websocket.send(data); -}; - -// socket 接收数据 -export const websocketonmessage = () => { - websocket.onmessage = function (e: any) { - if (e.data.indexOf('heartbeat') > 0) { - resetHeart(); - } - if (e.data.indexOf('ping') > 0) { - return; - } - useNoticeStore().addNotice({ - message: e.data, - read: false, - time: new Date().toLocaleString() - }); - ElNotification({ - title: '消息', - message: e.data, - type: 'success', - duration: 3000 - }); - return e.data; - }; + }); }; From 58412035ad8484a636b3af8baabb7bc087806ef3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 29 Jul 2024 15:02:59 +0800 Subject: [PATCH 12/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20vueuse=20=E9=87=8D=E6=9E=84=20websocket=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/websocket.ts | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/src/utils/websocket.ts b/src/utils/websocket.ts index 37942d8..ade13ef 100644 --- a/src/utils/websocket.ts +++ b/src/utils/websocket.ts @@ -1,23 +1,3 @@ -/** - * @module initWebSocket 初始化 - * @module websocketonopen 连接成功 - * @module websocketonerror 连接失败 - * @module websocketclose 断开连接 - * @module resetHeart 重置心跳 - * @module sendSocketHeart 心跳发送 - * @module reconnect 重连 - * @module sendMsg 发送数据 - * @module websocketonmessage 接收数据 - * @module test 测试收到消息传递 - * @description socket 通信 - * @param {any} url socket地址 - * @param {any} websocket websocket 实例 - * @param {any} heartTime 心跳定时器实例 - * @param {number} socketHeart 心跳次数 - * @param {number} HeartTimeOut 心跳超时时间 - * @param {number} socketError 错误次数 - */ - import { getToken } from '@/utils/auth'; import { ElNotification } from 'element-plus'; import useNoticeStore from '@/store/modules/notice'; From 076fc5deb1f72f4f83f84ecade7651d45de78e4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 2 Aug 2024 09:55:51 +0800 Subject: [PATCH 13/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0=E8=A1=A8=E6=A0=BC=E8=A1=8C=E9=80=89=E4=B8=AD=E5=88=87?= =?UTF-8?q?=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/authRole.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue index 87d2334..fe119ae 100644 --- a/src/views/system/user/authRole.vue +++ b/src/views/system/user/authRole.vue @@ -80,8 +80,8 @@ const tableRef = ref(); /** 单击选中行数据 */ const clickRow = (row: RoleVO) => { - // ele的方法有问题,selected应该为可选参数 - tableRef.value?.toggleRowSelection(row, false); + row.flag = !row.flag + tableRef.value?.toggleRowSelection(row, row.flag); }; /** 多选框选中数据 */ const handleSelectionChange = (selection: RoleVO[]) => { From 9193f0b84ac8deff766f7e9f0d9f8a7086642014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 2 Aug 2024 09:59:14 +0800 Subject: [PATCH 14/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E7=A7=9F=E6=88=B7=E5=90=8E=E5=88=B7=E6=96=B0=E9=A6=96?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/Navbar.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index fd4eb8c..c2ed0b6 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -128,6 +128,7 @@ const dynamicTenantEvent = async (tenantId: string) => { dynamic.value = true; proxy?.$tab.closeAllPage(); proxy?.$router.push('/'); + proxy?.$tab.refreshPage(); } }; @@ -136,6 +137,7 @@ const dynamicClearEvent = async () => { dynamic.value = false; proxy?.$tab.closeAllPage(); proxy?.$router.push('/'); + proxy?.$tab.refreshPage(); }; /** 租户列表 */ From 9eb7b433b4dabcd7907ffb84efb009206db88ea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 2 Aug 2024 13:53:48 +0800 Subject: [PATCH 15/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/workflow/nodeConfig/index.ts | 63 ---------------------------- src/permission.ts | 1 + src/plugins/tab.ts | 4 +- src/store/modules/permission.ts | 6 +-- src/store/modules/tagsView.ts | 22 +++++----- 5 files changed, 17 insertions(+), 79 deletions(-) delete mode 100644 src/api/workflow/nodeConfig/index.ts diff --git a/src/api/workflow/nodeConfig/index.ts b/src/api/workflow/nodeConfig/index.ts deleted file mode 100644 index 3270c17..0000000 --- a/src/api/workflow/nodeConfig/index.ts +++ /dev/null @@ -1,63 +0,0 @@ -import request from '@/utils/request'; -import { AxiosPromise } from 'axios'; -import { NodeConfigVO, NodeConfigForm, NodeConfigQuery } from '@/api/workflow/nodeConfig/types'; - -/** - * 查询节点配置列表 - * @param query - * @returns {*} - */ - -export const listNodeConfig = (query?: NodeConfigQuery): AxiosPromise => { - return request({ - url: '/workflow/nodeConfig/list', - method: 'get', - params: query - }); -}; - -/** - * 查询节点配置详细 - * @param id - */ -export const getNodeConfig = (id: string | number): AxiosPromise => { - return request({ - url: '/workflow/nodeConfig/' + id, - method: 'get' - }); -}; - -/** - * 新增节点配置 - * @param data - */ -export const addNodeConfig = (data: NodeConfigForm) => { - return request({ - url: '/workflow/nodeConfig', - method: 'post', - data: data - }); -}; - -/** - * 修改节点配置 - * @param data - */ -export const updateNodeConfig = (data: NodeConfigForm) => { - return request({ - url: '/workflow/nodeConfig', - method: 'put', - data: data - }); -}; - -/** - * 删除节点配置 - * @param id - */ -export const delNodeConfig = (id: string | number | Array) => { - return request({ - url: '/workflow/nodeConfig/' + id, - method: 'delete' - }); -}; diff --git a/src/permission.ts b/src/permission.ts index 6771f8c..125438b 100644 --- a/src/permission.ts +++ b/src/permission.ts @@ -40,6 +40,7 @@ router.beforeEach(async (to, from, next) => { router.addRoute(route); // 动态添加可访问路由表 } }); + // @ts-ignore next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成 } } else { diff --git a/src/plugins/tab.ts b/src/plugins/tab.ts index dd240cd..86421a8 100644 --- a/src/plugins/tab.ts +++ b/src/plugins/tab.ts @@ -1,5 +1,5 @@ import router from '@/router'; -import { RouteLocationMatched, RouteLocationNormalized } from 'vue-router'; +import {RouteLocationMatched, RouteLocationNormalized, RouteLocationRaw} from 'vue-router'; import useTagsViewStore from '@/store/modules/tagsView'; export default { @@ -41,7 +41,7 @@ export default { }); }, // 关闭当前tab页签,打开新页签 - closeOpenPage(obj: RouteLocationNormalized): void { + closeOpenPage(obj: RouteLocationRaw): void { useTagsViewStore().delView(router.currentRoute.value); if (obj !== undefined) { router.push(obj); diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 2e719ba..e90df4c 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -21,13 +21,13 @@ export const usePermissionStore = defineStore('permission', () => { const sidebarRouters = ref([]); const getRoutes = (): RouteRecordRaw[] => { - return routes.value; + return routes.value as RouteRecordRaw[]; }; const getSidebarRoutes = (): RouteRecordRaw[] => { - return sidebarRouters.value; + return sidebarRouters.value as RouteRecordRaw[]; }; const getTopbarRoutes = (): RouteRecordRaw[] => { - return topbarRouters.value; + return topbarRouters.value as RouteRecordRaw[]; }; const setRoutes = (newRoutes: RouteRecordRaw[]): void => { diff --git a/src/store/modules/tagsView.ts b/src/store/modules/tagsView.ts index b9502eb..9756ac2 100644 --- a/src/store/modules/tagsView.ts +++ b/src/store/modules/tagsView.ts @@ -6,10 +6,10 @@ export const useTagsViewStore = defineStore('tagsView', () => { const iframeViews = ref([]); const getVisitedViews = (): RouteLocationNormalized[] => { - return visitedViews.value; + return visitedViews.value as RouteLocationNormalized[]; }; const getIframeViews = (): RouteLocationNormalized[] => { - return iframeViews.value; + return iframeViews.value as RouteLocationNormalized[]; }; const getCachedViews = (): string[] => { return cachedViews.value; @@ -31,7 +31,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { const delIframeView = (view: RouteLocationNormalized): Promise => { return new Promise((resolve) => { iframeViews.value = iframeViews.value.filter((item: RouteLocationNormalized) => item.path !== view.path); - resolve([...iframeViews.value]); + resolve([...iframeViews.value as RouteLocationNormalized[]]); }); }; const addVisitedView = (view: RouteLocationNormalized): void => { @@ -54,7 +54,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { delCachedView(view); } resolve({ - visitedViews: [...visitedViews.value], + visitedViews: [...visitedViews.value as RouteLocationNormalized[]], cachedViews: [...cachedViews.value] }); }); @@ -68,7 +68,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { break; } } - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; const delCachedView = (view?: RouteLocationNormalized): Promise => { @@ -92,7 +92,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { delOthersVisitedViews(view); delOthersCachedViews(view); resolve({ - visitedViews: [...visitedViews.value], + visitedViews: [...visitedViews.value as RouteLocationNormalized[]], cachedViews: [...cachedViews.value] }); }); @@ -103,7 +103,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { visitedViews.value = visitedViews.value.filter((v: RouteLocationNormalized) => { return v.meta?.affix || v.path === view.path; }); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; const delOthersCachedViews = (view: RouteLocationNormalized): Promise => { @@ -124,7 +124,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { delAllVisitedViews(); delAllCachedViews(); resolve({ - visitedViews: [...visitedViews.value], + visitedViews: [...visitedViews.value as RouteLocationNormalized[]], cachedViews: [...cachedViews.value] }); }); @@ -132,7 +132,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { const delAllVisitedViews = (): Promise => { return new Promise((resolve) => { visitedViews.value = visitedViews.value.filter((tag: RouteLocationNormalized) => tag.meta?.affix); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; @@ -167,7 +167,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { } return false; }); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; const delLeftTags = (view: RouteLocationNormalized): Promise => { @@ -186,7 +186,7 @@ export const useTagsViewStore = defineStore('tagsView', () => { } return false; }); - resolve([...visitedViews.value]); + resolve([...visitedViews.value as RouteLocationNormalized[]]); }); }; From c0ee3182e16527e01a19c00eed020f1350a58979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 8 Aug 2024 18:19:18 +0800 Subject: [PATCH 16/20] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E5=A5=97=E9=A4=90=E5=AF=BC=E5=87=BA=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/tenantPackage/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/system/tenantPackage/index.vue b/src/views/system/tenantPackage/index.vue index 55cc7d7..30c9455 100644 --- a/src/views/system/tenantPackage/index.vue +++ b/src/views/system/tenantPackage/index.vue @@ -321,7 +321,7 @@ const handleDelete = async (row?: TenantPkgVO) => { /** 导出按钮操作 */ const handleExport = () => { proxy?.download( - 'system/tenantPackage/export', + 'system/package/export', { ...queryParams.value }, From 335a1e601910f8a40b18ba837dd6d878a2f3ee7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 8 Aug 2024 18:19:58 +0800 Subject: [PATCH 17/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20oss=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=8C=89=E9=92=AE=20=E4=BD=BF=E7=94=A8ossCon?= =?UTF-8?q?fig=E6=9D=83=E9=99=90=E6=A0=87=E8=AF=86=E7=AC=A6=E4=B8=8Eoss?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=88=86=E7=A6=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/oss/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/system/oss/index.vue b/src/views/system/oss/index.vue index a6e60e8..d057c23 100644 --- a/src/views/system/oss/index.vue +++ b/src/views/system/oss/index.vue @@ -60,7 +60,7 @@ > - 配置管理 + 配置管理 From e5727893bbfb166118798edcdfed805d77c3f606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Thu, 15 Aug 2024 18:05:19 +0800 Subject: [PATCH 18/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=90=9C=E7=B4=A2=E7=BB=84=E4=BB=B6=E7=BB=9F=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/role/index.vue | 2 +- src/views/system/user/index.vue | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/system/role/index.vue b/src/views/system/role/index.vue index 0b6ba00..f2299d7 100644 --- a/src/views/system/role/index.vue +++ b/src/views/system/role/index.vue @@ -18,7 +18,7 @@ From 2c8873402f94d26f6fffc43cfee9d254a27cc2df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Fri, 16 Aug 2024 13:01:54 +0800 Subject: [PATCH 19/20] =?UTF-8?q?update=20=E4=BC=98=E5=8C=96=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=8C=B9=E9=85=8D=E6=A8=A1=E5=BC=8F=E7=AE=80=E5=8C=96?= =?UTF-8?q?=E9=A2=84=E7=BC=96=E8=AF=91=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vite.config.ts | 56 +------------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/vite.config.ts b/vite.config.ts index f8b1200..97c8d9d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -75,61 +75,7 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => { 'diagram-js/lib/draw/BaseRenderer', 'tiny-svg', 'image-conversion', - - 'element-plus/es/components/text/style/css', - 'element-plus/es/components/collapse-item/style/css', - 'element-plus/es/components/collapse/style/css', - 'element-plus/es/components/space/style/css', - 'element-plus/es/components/container/style/css', - 'element-plus/es/components/aside/style/css', - 'element-plus/es/components/main/style/css', - 'element-plus/es/components/header/style/css', - 'element-plus/es/components/button-group/style/css', - 'element-plus/es/components/radio-button/style/css', - 'element-plus/es/components/checkbox-group/style/css', - 'element-plus/es/components/form/style/css', - 'element-plus/es/components/form-item/style/css', - 'element-plus/es/components/button/style/css', - 'element-plus/es/components/input/style/css', - 'element-plus/es/components/input-number/style/css', - 'element-plus/es/components/switch/style/css', - 'element-plus/es/components/upload/style/css', - 'element-plus/es/components/menu/style/css', - 'element-plus/es/components/col/style/css', - 'element-plus/es/components/icon/style/css', - 'element-plus/es/components/row/style/css', - 'element-plus/es/components/tag/style/css', - 'element-plus/es/components/dialog/style/css', - 'element-plus/es/components/loading/style/css', - 'element-plus/es/components/radio/style/css', - 'element-plus/es/components/radio-group/style/css', - 'element-plus/es/components/popover/style/css', - 'element-plus/es/components/scrollbar/style/css', - 'element-plus/es/components/tooltip/style/css', - 'element-plus/es/components/dropdown/style/css', - 'element-plus/es/components/dropdown-menu/style/css', - 'element-plus/es/components/dropdown-item/style/css', - 'element-plus/es/components/sub-menu/style/css', - 'element-plus/es/components/menu-item/style/css', - 'element-plus/es/components/divider/style/css', - 'element-plus/es/components/card/style/css', - 'element-plus/es/components/link/style/css', - 'element-plus/es/components/breadcrumb/style/css', - 'element-plus/es/components/breadcrumb-item/style/css', - 'element-plus/es/components/table/style/css', - 'element-plus/es/components/tree-select/style/css', - 'element-plus/es/components/table-column/style/css', - 'element-plus/es/components/select/style/css', - 'element-plus/es/components/option/style/css', - 'element-plus/es/components/pagination/style/css', - 'element-plus/es/components/tree/style/css', - 'element-plus/es/components/alert/style/css', - 'element-plus/es/components/checkbox/style/css', - 'element-plus/es/components/date-picker/style/css', - 'element-plus/es/components/transfer/style/css', - 'element-plus/es/components/tabs/style/css', - 'element-plus/es/components/image/style/css', - 'element-plus/es/components/tab-pane/style/css' + 'element-plus/es/components/**/css' ] } }; From 3c2d9100b50c7b609d3f3c0367869d023e103d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Mon, 26 Aug 2024 11:40:53 +0800 Subject: [PATCH 20/20] =?UTF-8?q?=F0=9F=98=B4=E5=8F=91=E5=B8=83=20vue=20?= =?UTF-8?q?=E7=89=88=E6=9C=AC=205.2.2=20=E4=B8=8E=20cloud=20=E7=89=88?= =?UTF-8?q?=E6=9C=AC=202.2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/views/index.vue | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 29cb290..48b1571 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi-vue-plus", - "version": "5.2.1", + "version": "5.2.2", "description": "RuoYi-Vue-Plus多租户管理系统", "author": "LionLi", "license": "MIT", diff --git a/src/views/index.vue b/src/views/index.vue index aa60a9b..7bd19e4 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -33,7 +33,7 @@ * 部署方式 Docker 容器编排 一键部署业务集群
* 国际化 SpringMessage Spring标准国际化方案

-

当前版本: v5.2.1

+

当前版本: v5.2.2

¥免费开源

@@ -77,7 +77,7 @@ * 分布式监控 Prometheus、Grafana 全方位性能监控
* 其余与 Vue 版本一致

-

当前版本: v2.2.0

+

当前版本: v2.2.1

¥免费开源