| | |
| | | @ApiOperation(value = "新增") |
| | | @PostMapping("add") |
| | | public Result<?> add(@RequestBody @Valid BannerModel model) { |
| | | model.setLoginSafeword(passwordManager.decryptPassword(model.getLoginSafeword())); |
| | | SysUser sysUser = sysUserService.getSysUserById(SecurityUtils.getSysUser().getUserId()); |
| | | if (!passwordEncoder.matches(model.getLoginSafeword(), sysUser.getSafePassword())) { |
| | | throw new YamiShopBindException("资金密码不正确!"); |
| | | } |
| | | if (StrUtil.isEmpty(model.getImage())){ |
| | | throw new YamiShopBindException("展示图片不能为空"); |
| | | } |
| | |
| | | @ApiOperation(value = "更新") |
| | | @PostMapping("update") |
| | | public Result<?> update(@RequestBody @Valid BannerModel model) { |
| | | model.setLoginSafeword(passwordManager.decryptPassword(model.getLoginSafeword())); |
| | | SysUser sysUser = sysUserService.getSysUserById(SecurityUtils.getSysUser().getUserId()); |
| | | if (!passwordEncoder.matches(model.getLoginSafeword(), sysUser.getSafePassword())) { |
| | | throw new YamiShopBindException("资金密码不正确!"); |
| | | } |
| | | if (StrUtil.isEmpty(model.getImage())){ |
| | | throw new YamiShopBindException("展示图片不能为空"); |
| | | } |