From 06c705e2b52ef06c357450a5a90fd14283a75aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BA=84=E9=94=90=E6=B3=A2?= <10549902+zhuangruibo@user.noreply.gitee.com> Date: Thu, 25 Jun 2026 11:35:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=89=AB=E6=8F=8F=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ng/14/nginx.conf | 2 +- ng/15/nginx.conf | 3 ++ .../service/impl/SysRoleServiceImpl.java | 17 +++++++- .../vite-config/index.js | 39 +++++++++++-------- .../vite-env/.env.enterprise-dev-wmy | 2 +- 5 files changed, 42 insertions(+), 21 deletions(-) diff --git a/ng/14/nginx.conf b/ng/14/nginx.conf index 929987f0..af85d616 100644 --- a/ng/14/nginx.conf +++ b/ng/14/nginx.conf @@ -28,7 +28,7 @@ http { types_hash_max_size 4096; # 限制请求体大小 - client_max_body_size 100m; + client_max_body_size 50m; include /etc/nginx/mime.types; default_type application/octet-stream; diff --git a/ng/15/nginx.conf b/ng/15/nginx.conf index f1a852e4..1c335c5d 100644 --- a/ng/15/nginx.conf +++ b/ng/15/nginx.conf @@ -27,6 +27,9 @@ http { keepalive_timeout 65; types_hash_max_size 4096; + # 限制请求体大小 + client_max_body_size 50m; + include /etc/nginx/mime.types; default_type application/octet-stream; diff --git a/zdxt-modules/zdxt-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java b/zdxt-modules/zdxt-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java index 0d5d0d9e..61b86203 100644 --- a/zdxt-modules/zdxt-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java +++ b/zdxt-modules/zdxt-system/src/main/java/org/dromara/system/service/impl/SysRoleServiceImpl.java @@ -1,5 +1,6 @@ package org.dromara.system.service.impl; +import cn.dev33.satoken.exception.ApiDisabledException; import cn.dev33.satoken.exception.NotLoginException; import cn.dev33.satoken.stp.StpUtil; import cn.hutool.core.bean.BeanUtil; @@ -544,7 +545,13 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService { if (num == 0) { return; } - List keys = StpUtil.searchTokenValue("", 0, -1, false); + List keys; + try { + keys = StpUtil.searchTokenValue("", 0, -1, false); + } catch (ApiDisabledException e) { + // JWT模式下不支持searchTokenValue,跳过在线用户清理 + return; + } if (CollUtil.isEmpty(keys)) { return; } @@ -586,7 +593,13 @@ public class SysRoleServiceImpl implements ISysRoleService, RoleService { */ @Override public void cleanOnlineUser(List userIds) { - List keys = StpUtil.searchTokenValue("", 0, -1, false); + List keys; + try { + keys = StpUtil.searchTokenValue("", 0, -1, false); + } catch (ApiDisabledException e) { + // JWT模式下不支持searchTokenValue,跳过在线用户清理 + return; + } if (CollUtil.isEmpty(keys)) { return; } diff --git a/zdxt-web-client/zdxt-efcode-enterprise-app/vite-config/index.js b/zdxt-web-client/zdxt-efcode-enterprise-app/vite-config/index.js index edb48e4d..96a4a69c 100644 --- a/zdxt-web-client/zdxt-efcode-enterprise-app/vite-config/index.js +++ b/zdxt-web-client/zdxt-efcode-enterprise-app/vite-config/index.js @@ -42,22 +42,22 @@ const baseCfg = (viteEnv = {}) => { open: false, cors: true, proxy: { - '/efcode20-ent-app/api/ent-ep': { - target: VITE_PROXY_TARGET ||'http://139.186.148.21:8080', - changeOrigin: true, - rewrite: (path) => path.replace(/^\/efcode20-ent-app\/api\/ent-ep/, ''), - configure: (proxy) => { - proxy.on('proxyReq', (proxyReq, req) => { - console.log(`[Proxy] ${req.method} ${req.url} → ${proxyReq.protocol}//${proxyReq.host}${proxyReq.path}`); - }); - proxy.on('proxyRes', (proxyRes, req) => { - console.log(`[Proxy] ${proxyRes.statusCode} ← ${req.method} ${req.url}`); - }); - proxy.on('error', (err, req) => { - console.error(`[Proxy Error] ${req.method} ${req.url}`, err.message); - }); - } - }, + // '/efcode20-ent-app/api/ent-ep': { + // target: VITE_PROXY_TARGET ||'http://139.186.148.21:8080', + // changeOrigin: true, + // rewrite: (path) => path.replace(/^\/efcode20-ent-app\/api\/ent-ep/, ''), + // configure: (proxy) => { + // proxy.on('proxyReq', (proxyReq, req) => { + // console.log(`[Proxy] ${req.method} ${req.url} → ${proxyReq.protocol}//${proxyReq.host}${proxyReq.path}`); + // }); + // proxy.on('proxyRes', (proxyRes, req) => { + // console.log(`[Proxy] ${proxyRes.statusCode} ← ${req.method} ${req.url}`); + // }); + // proxy.on('error', (err, req) => { + // console.error(`[Proxy Error] ${req.method} ${req.url}`, err.message); + // }); + // } + // }, '/efcode20-ent-app/api': { target: VITE_PROXY_TARGET ||'http://139.186.148.21:8080', changeOrigin: true, @@ -76,7 +76,12 @@ const baseCfg = (viteEnv = {}) => { }, '/profile': { target: VITE_PROXY_TARGET || 'http://139.186.148.21:8080', - rewrite: (path) => path.replace(/^\/profile/, '/ent-ep/profile'), + rewrite: (path) => { + if (VITE_BASE_URL.includes('ent-ep')) { + return path.replace(/^\/profile/, '/ent-ep/profile'); + } + return path.replace(/^\/profile/, '/profile') + }, changeOrigin: true, } } diff --git a/zdxt-web-client/zdxt-efcode-enterprise-app/vite-env/.env.enterprise-dev-wmy b/zdxt-web-client/zdxt-efcode-enterprise-app/vite-env/.env.enterprise-dev-wmy index 1e52cd79..d78299bc 100644 --- a/zdxt-web-client/zdxt-efcode-enterprise-app/vite-env/.env.enterprise-dev-wmy +++ b/zdxt-web-client/zdxt-efcode-enterprise-app/vite-env/.env.enterprise-dev-wmy @@ -1,7 +1,7 @@ # 企业端开发环境 VITE_PORT = 12001 VITE_PROXY_TARGET = 'http://139.186.148.21:8080' -VITE_BASE_URL = '/efcode20-ent-app/api/ent-ep' +VITE_BASE_URL = '/efcode20-ent-app/api' VITE_CONTEXT_PATH = '/efcode20-ent-app/' VITE_DEFAULT_LOGIN = '/enterprise/loginByPassword' VITE_FILE_URL = ''