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;