From 316cc7ea4852c2f484a16ca218e1a419cb5cc1a8 Mon Sep 17 00:00:00 2001 From: Leo Date: Tue, 2 Dec 2025 17:39:35 +0800 Subject: [PATCH] 1 --- src/main/java/cn/van333/wxsend/util/WxSendUtil.java | 8 ++++++-- ~/logs/sys-error.log | 0 ~/logs/sys-info.log | 12 ++++++++++++ ~/logs/sys-user.log | 0 4 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 ~/logs/sys-error.log create mode 100644 ~/logs/sys-info.log create mode 100644 ~/logs/sys-user.log diff --git a/src/main/java/cn/van333/wxsend/util/WxSendUtil.java b/src/main/java/cn/van333/wxsend/util/WxSendUtil.java index b51abed..8655ad8 100644 --- a/src/main/java/cn/van333/wxsend/util/WxSendUtil.java +++ b/src/main/java/cn/van333/wxsend/util/WxSendUtil.java @@ -93,7 +93,9 @@ public class WxSendUtil { touser.forEach(t -> touserStringBuilder.append(t).append("|") ); - touserStr = touserStringBuilder.substring(0, touser.size() - 1); + // 修复bug: 应该使用 touserStringBuilder.length() - 1,而不是 touser.size() - 1 + // 因为要删除最后一个 "|" 字符,应该基于字符串长度而不是列表大小 + touserStr = touserStringBuilder.substring(0, touserStringBuilder.length() - 1); } else { touserStr = touserStringBuilder.append(touser.get(0)).toString(); } @@ -169,7 +171,9 @@ public class WxSendUtil { touser.forEach(t -> touserStringBuilder.append(t).append("|") ); - touserStr = touserStringBuilder.substring(0, touser.size() - 1); + // 修复bug: 应该使用 touserStringBuilder.length() - 1,而不是 touser.size() - 1 + // 因为要删除最后一个 "|" 字符,应该基于字符串长度而不是列表大小 + touserStr = touserStringBuilder.substring(0, touserStringBuilder.length() - 1); } else { touserStr = touserStringBuilder.append(touser.get(0)).toString(); } diff --git a/~/logs/sys-error.log b/~/logs/sys-error.log new file mode 100644 index 0000000..e69de29 diff --git a/~/logs/sys-info.log b/~/logs/sys-info.log new file mode 100644 index 0000000..64dd7f0 --- /dev/null +++ b/~/logs/sys-info.log @@ -0,0 +1,12 @@ +14:56:51.623 [main] INFO c.v.w.WxSendApplication - [logStarting,55] - Starting WxSendApplication using Java 1.8.0_381 on Van with PID 307388 (D:\Code\wxSend\target\classes started by 80787 in D:\Code\wxSend) +14:56:51.625 [main] INFO c.v.w.WxSendApplication - [logStartupProfileInfo,645] - No active profile set, falling back to 1 default profile: "default" +14:56:52.168 [main] INFO o.s.b.w.e.t.TomcatWebServer - [initialize,108] - Tomcat initialized with port(s): 8080 (http) +14:56:52.173 [main] INFO o.a.c.h.Http11NioProtocol - [log,173] - Initializing ProtocolHandler ["http-nio-8080"] +14:56:52.174 [main] INFO o.a.c.c.StandardService - [log,173] - Starting service [Tomcat] +14:56:52.174 [main] INFO o.a.c.c.StandardEngine - [log,173] - Starting Servlet engine: [Apache Tomcat/9.0.68] +14:56:52.272 [main] INFO o.a.c.c.C.[.[.[/] - [log,173] - Initializing Spring embedded WebApplicationContext +14:56:52.272 [main] INFO o.s.b.w.s.c.ServletWebServerApplicationContext - [prepareWebApplicationContext,290] - Root WebApplicationContext: initialization completed in 618 ms +14:56:52.523 [main] INFO o.s.s.w.DefaultSecurityFilterChain - [,55] - Will secure any request with [org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@74abbb, org.springframework.security.web.context.SecurityContextPersistenceFilter@b10a26d, org.springframework.security.web.header.HeaderWriterFilter@252f626c, org.springframework.security.web.csrf.CsrfFilter@6972c30a, org.springframework.security.web.authentication.logout.LogoutFilter@15ac59c2, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@b965857, org.springframework.security.web.authentication.ui.DefaultLoginPageGeneratingFilter@6d9fb2d1, org.springframework.security.web.authentication.ui.DefaultLogoutPageGeneratingFilter@64a4dd8d, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@4cb0a000, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@7e4d2287, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@31464a43, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@2dddc1b9, org.springframework.security.web.session.SessionManagementFilter@48284d0e, org.springframework.security.web.access.ExceptionTranslationFilter@7cf283e1, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@4ba380c7] +14:56:52.555 [main] INFO o.a.c.h.Http11NioProtocol - [log,173] - Starting ProtocolHandler ["http-nio-8080"] +14:56:52.564 [main] INFO o.s.b.w.e.t.TomcatWebServer - [start,220] - Tomcat started on port(s): 8080 (http) with context path '' +14:56:52.572 [main] INFO c.v.w.WxSendApplication - [logStarted,61] - Started WxSendApplication in 1.283 seconds (JVM running for 1.809) diff --git a/~/logs/sys-user.log b/~/logs/sys-user.log new file mode 100644 index 0000000..e69de29