From 3458cbb67d8b784ef9d9f112f6c56f9100ef5084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E8=BE=89?= <1101635162@qq.com> Date: Tue, 29 Oct 2024 14:18:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=BF=E7=94=A8apiKey=E7=99=BB=E5=BD=95Web?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/b3log/symphony/processor/ApiProcessor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/b3log/symphony/processor/ApiProcessor.java b/src/main/java/org/b3log/symphony/processor/ApiProcessor.java index 7b493a5d..bb519d63 100644 --- a/src/main/java/org/b3log/symphony/processor/ApiProcessor.java +++ b/src/main/java/org/b3log/symphony/processor/ApiProcessor.java @@ -142,7 +142,11 @@ public void loginWebInApiKey(final RequestContext context) { if (null != currentUser) { final Response response = context.getResponse(); - response.sendRedirect(Latkes.getServePath()); + String r = context.param("r"); + if (null == r) { + r = "/"; + } + response.sendRedirect(Latkes.getServePath() + r); Sessions.login(response, currentUser.optString(Keys.OBJECT_ID), true); } else { context.renderJSON(StatusCodes.ERR).renderMsg("ApiKey 错误。");