| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.security.crypto.password.PasswordEncoder; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @ApiOperation("修改登录密码") |
| | | @SysLog("修改登录密码") |
| | | public Result<?> changeLoginPassword(@RequestBody @Valid ChangeLoginPasswordModel model) { |
| | | model.setOldPassword(passwordManager.decryptPassword(model.getOldPassword())); |
| | | throw new YamiShopBindException("请联系管理员!"); |
| | | /*model.setOldPassword(passwordManager.decryptPassword(model.getOldPassword())); |
| | | model.setNewPassword(passwordManager.decryptPassword(model.getNewPassword())); |
| | | Long userId = SecurityUtils.getSysUser().getUserId(); |
| | | SysUser user = sysUserService.getById(userId); |
| | |
| | | throw new YamiShopBindException("旧密码不正确!"); |
| | | } |
| | | user.setPassword(passwordEncoder.encode(model.getNewPassword())); |
| | | return Result.ok(null); |
| | | sysUserService.updateById(user); |
| | | return Result.ok(null);*/ |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | ).collect(Collectors.toSet()); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | PasswordEncoder passwordEncoder = new BCryptPasswordEncoder(); |
| | | String pwd = "qw012187"; |
| | | String ePwd = passwordEncoder.encode(pwd); |
| | | System.out.println(pwd); |
| | | System.out.println(ePwd); |
| | | } |
| | | } |