From 2ee58cefb02e8b8d07ff8a94f61cc8ee28a34380 Mon Sep 17 00:00:00 2001 From: weiweiw <14335254+weiweiw22@user.noreply.gitee.com> Date: Tue, 12 Nov 2024 10:53:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?tokentime=E7=9A=84=E8=BE=93=E5=85=A5?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E8=BF=9B=E8=A1=8C=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/index.vue | 8 +++++--- src/views/system/config/index.vue | 5 +++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/layout/index.vue b/src/layout/index.vue index 8412aa25..98c78ac8 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -81,7 +81,7 @@ export default { ] }, socket: null, - wsUrl: 'ws://localhost:18082/ws', // WebSocket 端点 + wsUrl: JSON.parse(localStorage.getItem('systemConfig')).webSocketurl,//'ws://localhost:18082/ws', // WebSocket 端点 isConnected: false, // 连接状态 reconnectInterval: 5000 // 自动重连时间间隔(毫秒 @@ -120,7 +120,9 @@ export default { }, created() { this.checkPasswordStatus() - if (this.roles.includes("audit") || this.roles.includes("systemAdmin")) { + console.log("*******************") + console.log(this.roles) + if (this.roles.includes("audit") || this.roles.includes("systemAdmin")|| this.roles.includes("admin")) { this.connectWebSocket(); } }, @@ -158,7 +160,7 @@ export default { console.log("WebSocket 已连接"); return; } - + console.log("WebSocket URL:{}",this.wsUrl) this.socket = new WebSocket(this.wsUrl); // 监听 WebSocket 连接成功事件 diff --git a/src/views/system/config/index.vue b/src/views/system/config/index.vue index 8b417468..19a6d9e4 100644 --- a/src/views/system/config/index.vue +++ b/src/views/system/config/index.vue @@ -300,6 +300,11 @@ export default { submitForm: function() { this.$refs["form"].validate(valid => { if (valid) { + if (this.form.configKey === "sys.visit.tokentime" && (this.form.configValue <=0 || this.form.configValue > 30 )) + { + this.$modal.msgError("系统访问token有效期必须在0-30分钟之间"); + return; + } if (this.form.configId != undefined) { updateConfig(this.form).then(response => { this.$modal.msgSuccess("修改成功"); From 5691d366f9768d8be44cac4b6bf4e1bbac85a2ce Mon Sep 17 00:00:00 2001 From: weiweiw <14335254+weiweiw22@user.noreply.gitee.com> Date: Tue, 12 Nov 2024 14:56:22 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=89=8B=E6=9C=BA=E5=8F=B7=E8=84=B1?= =?UTF-8?q?=E6=95=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/log.js | 6 +++ src/layout/index.vue | 66 +++++++++++++++++++++------------ src/views/system/user/index.vue | 11 +++++- 3 files changed, 58 insertions(+), 25 deletions(-) diff --git a/src/api/system/log.js b/src/api/system/log.js index fc3b90b2..37abfb25 100644 --- a/src/api/system/log.js +++ b/src/api/system/log.js @@ -92,6 +92,12 @@ export function getLogSize(data) { }) } +export function handleNoWarningLog(data) { + return request({ + url: '/system/sys/sysLog/logWarn', + method: 'get' + }) +} diff --git a/src/layout/index.vue b/src/layout/index.vue index 98c78ac8..e3c246a1 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -25,10 +25,6 @@ -