Przeglądaj źródła

修改定时获取人员定时任务

lirui 3 lat temu
rodzic
commit
41316bda48

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/modules/quartz/task/ZkDataSyncTask.java

@@ -266,10 +266,10 @@ public class ZkDataSyncTask {
                     log.info("userCode:"+user.getUserCode());
                     log.info("userCode:"+user.getUserCode());
                     userDto = userService.findById(user.getId());
                     userDto = userService.findById(user.getId());
                     if (userDto != null) {
                     if (userDto != null) {
-                        user.setPassword(RsaUtils.encryptByPrivateKey(RsaProperties.privateKey, "12345678"));
+                        user.setPassword(RsaUtils.encryptByPublicKey(RsaProperties.publicKey, "12345678"));
                         userService.updateSync(user);
                         userService.updateSync(user);
                     } else {
                     } else {
-                        user.setPassword(RsaUtils.encryptByPrivateKey(RsaProperties.privateKey, "12345678"));
+                        user.setPassword(RsaUtils.encryptByPublicKey(RsaProperties.publicKey, "12345678"));
                         userService.createSync(user);
                         userService.createSync(user);
                     }
                     }
                 } catch (Exception e) {
                 } catch (Exception e) {

+ 2 - 2
eladmin-system/src/main/java/me/zhengjie/modules/system/rest/UserController.java

@@ -108,9 +108,9 @@ public class UserController {
     @ApiOperation("新增用户")
     @ApiOperation("新增用户")
     @PostMapping
     @PostMapping
     @PreAuthorize("@el.check('user:add')")
     @PreAuthorize("@el.check('user:add')")
-    public ResponseEntity<Object> create(@Validated @RequestBody User resources){
+    public ResponseEntity<Object> create(@Validated @RequestBody User resources) throws Exception {
         checkLevel(resources);
         checkLevel(resources);
-        resources.setPassword(passwordEncoder.encode(resources.getOrgPassword()));
+        resources.setPassword(RsaUtils.encryptByPublicKey(RsaProperties.publicKey, resources.getOrgPassword()));
         userService.create(resources);
         userService.create(resources);
         return new ResponseEntity<>(HttpStatus.CREATED);
         return new ResponseEntity<>(HttpStatus.CREATED);
     }
     }