|
|
|
@ -57,9 +57,17 @@ 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); |
|
|
|
|
switch (usr.getRole()) { |
|
|
|
|
case admin: { |
|
|
|
|
session.setAttribute("usr", usr); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
default: |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
session.setAttribute(Webs.ME, subject.getPrincipal()); |
|
|
|
|
return new ServerRedirectView("/admin/main.rk"); |
|
|
|
|