From e17095cc7e7aa9bf8e1ed67ffa9f56c33c6c6e37 Mon Sep 17 00:00:00 2001 From: Yutousama <583819556@qq.com> Date: Sat, 16 Jul 2022 16:13:28 +0800 Subject: [PATCH] =?UTF-8?q?add:=E5=BC=80=E5=8F=91=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E4=B8=8D=E5=81=9A=E8=BA=AB=E4=BB=BD=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yutou/tools/AuthConfig/RoleAccessDecisionManager.java | 1 + src/main/java/com/yutou/tools/utils/Tools.java | 3 +++ 2 files changed, 4 insertions(+) diff --git a/src/main/java/com/yutou/tools/AuthConfig/RoleAccessDecisionManager.java b/src/main/java/com/yutou/tools/AuthConfig/RoleAccessDecisionManager.java index f0d1e35..8bd600e 100644 --- a/src/main/java/com/yutou/tools/AuthConfig/RoleAccessDecisionManager.java +++ b/src/main/java/com/yutou/tools/AuthConfig/RoleAccessDecisionManager.java @@ -46,6 +46,7 @@ public class RoleAccessDecisionManager implements AccessDecisionManager { return; } if("dev".equals(ConfigTools.load(ConfigTools.CONFIG, "model"))) { + authentication.setAuthenticated(true); return; } if(url.endsWith(".ts")||url.endsWith(".m3u8")){ diff --git a/src/main/java/com/yutou/tools/utils/Tools.java b/src/main/java/com/yutou/tools/utils/Tools.java index 401134f..3c8edfc 100644 --- a/src/main/java/com/yutou/tools/utils/Tools.java +++ b/src/main/java/com/yutou/tools/utils/Tools.java @@ -434,6 +434,9 @@ public class Tools { } public static String getLoginUser() { + if("dev".equals(ConfigTools.load(ConfigTools.CONFIG, "model"))) { + return "admin"; + } Object user = SecurityContextHolder.getContext().getAuthentication().getPrincipal(); if (user instanceof String) { return (String) user;