|
@@ -78,6 +78,7 @@ public class PersonInfoController {
|
|
|
personInfo.setDelFlag(false);
|
|
personInfo.setDelFlag(false);
|
|
|
personInfo.setCreateBy(subject);
|
|
personInfo.setCreateBy(subject);
|
|
|
personInfo.setCreateTime(new Date());
|
|
personInfo.setCreateTime(new Date());
|
|
|
|
|
+ personInfo.setPassword(AESUtil.encrypt("123456",AESUtil.MYSQL_ENC_KEY));//初始密码设置
|
|
|
|
|
|
|
|
int affectCount = personInfoService.insert(personInfo);
|
|
int affectCount = personInfoService.insert(personInfo);
|
|
|
|
|
|
|
@@ -391,4 +392,35 @@ public class PersonInfoController {
|
|
|
|
|
|
|
|
return msgResult;
|
|
return msgResult;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @PostMapping("resetPassword")
|
|
|
|
|
+ @ApiOperation(value = "重置密码")
|
|
|
|
|
+ public MessageResult<Map> resetPassword(
|
|
|
|
|
+ @RequestParam(value="id",defaultValue="") String id,
|
|
|
|
|
+ @RequestAttribute String subject) {
|
|
|
|
|
+
|
|
|
|
|
+ MessageResult<Map> messageResult = new MessageResult<>();
|
|
|
|
|
+
|
|
|
|
|
+ try {
|
|
|
|
|
+
|
|
|
|
|
+ Map<String, Object> dataMap = new HashMap<String, Object>();
|
|
|
|
|
+ PersonInfo personInfo = personInfoService.get(id);
|
|
|
|
|
+
|
|
|
|
|
+ if (personInfo != null) {
|
|
|
|
|
+ personInfo.setPassword(AESUtil.encrypt("123456",AESUtil.MYSQL_ENC_KEY));
|
|
|
|
|
+ personInfo.setUpdateTime(new Date());
|
|
|
|
|
+ personInfoService.update(personInfo);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ messageResult.setData(dataMap);
|
|
|
|
|
+ messageResult.setResult(true);
|
|
|
|
|
+ messageResult.setCode(200);
|
|
|
|
|
+ } catch (Exception ex) {
|
|
|
|
|
+ messageResult.setCode(400);
|
|
|
|
|
+ messageResult.setResult(false);
|
|
|
|
|
+ messageResult.setMessage(ex.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return messageResult;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|