From cf053d49daff6d4721ee51656a4165ac5efdaf20 Mon Sep 17 00:00:00 2001 From: kouxian Date: Wed, 31 Aug 2016 10:18:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=20=E8=B4=A6=E5=8F=B7=E7=99=BB=E9=99=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/rekoe/module/admin/AdminLoginAct.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/rekoe/module/admin/AdminLoginAct.java b/src/main/java/com/rekoe/module/admin/AdminLoginAct.java index d570805..a5a3d4e 100644 --- a/src/main/java/com/rekoe/module/admin/AdminLoginAct.java +++ b/src/main/java/com/rekoe/module/admin/AdminLoginAct.java @@ -57,7 +57,8 @@ public class AdminLoginAct { Subject subject = SecurityUtils.getSubject(); ThreadContext.bind(subject); subject.login(token); - Usr usr = usrService.fetch(Cnd.where("usr", "=", "admin")); + User user = (User) subject.getPrincipal(); + Usr usr = usrService.fetch(Cnd.where("usr", "=", user.getName())); if (!Lang.isEmpty(usr)) { session.setAttribute("usr", usr); }