|
@@ -61,12 +61,12 @@ public class SecurityController {
|
|
|
@ResponseBody
|
|
|
public AjaxResult getToken(@RequestBody TokenRequest form) {
|
|
|
//解密密码字符串
|
|
|
-// String privateKey = redisService.getCacheObject("remoteSecretKey");
|
|
|
-// try {
|
|
|
-// RsaUtil.decrypt(form.getUsername(), privateKey);
|
|
|
-// } catch (Exception e) {
|
|
|
-// return AjaxResult.error("获取token失败").put("data", null).put("code",40002);
|
|
|
-// }
|
|
|
+ String privateKey = redisService.getCacheObject("remoteSecretKey");
|
|
|
+ try {
|
|
|
+ RsaUtil.decrypt(form.getUsername(), privateKey);
|
|
|
+ } catch (Exception e) {
|
|
|
+ return AjaxResult.error("获取token失败").put("data", null).put("code",40002);
|
|
|
+ }
|
|
|
SysUser user = userService.selectUserByLoginName(form.getUsername());
|
|
|
String token = JwtUtils.createToken(form.getUsername(), user.getPassword());
|
|
|
try {
|