想给nutzwk加一个记住密码的功能,shiro生成token时记住密码也生成了。登录的方法我该怎么改?怎么能在页面吧用户名密码现实上去?有什么思路吗?
@At("")
@Ok("re")
@Filters
public String login(HttpServletRequest req, HttpSession session) {
Subject subject = SecurityUtils.getSubject();
if (subject.isAuthenticated()) {
return "redirect:/platform/home";
} else {
try {
HashMap<String, Object> map = RSAUtil.getKeys();
//生成公钥和私钥
RSAPublicKey publicKey = (RSAPublicKey) map.get("public");
RSAPrivateKey privateKey = (RSAPrivateKey) map.get("private");
//模
String publicKeyModulus = publicKey.getModulus().toString(16);
//公钥指数
String publicKeyExponent = publicKey.getPublicExponent().toString(16);
//私钥指数
req.setAttribute("publicKeyExponent", publicKeyExponent);
req.setAttribute("publicKeyModulus", publicKeyModulus);
session.setAttribute("platformPrivateKey", privateKey);
} catch (Exception e) {
e.printStackTrace();
}
return "beetl:/platform/sys/login.html";
}
}