bihuisong 1 年之前
父节点
当前提交
5db282d7b8
共有 1 个文件被更改,包括 6 次插入6 次删除
  1. 6 6
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SecurityController.java

+ 6 - 6
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SecurityController.java

@@ -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 {