支持管理员 账号登陆

pull/3/head
kouxian 2016-08-31 10:18:45 +08:00
parent 70acd84e73
commit cf053d49da
1 changed files with 2 additions and 1 deletions

View File

@ -57,7 +57,8 @@ public class AdminLoginAct {
Subject subject = SecurityUtils.getSubject(); Subject subject = SecurityUtils.getSubject();
ThreadContext.bind(subject); ThreadContext.bind(subject);
subject.login(token); 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)) { if (!Lang.isEmpty(usr)) {
session.setAttribute("usr", usr); session.setAttribute("usr", usr);
} }