123
This commit is contained in:
@@ -46,7 +46,7 @@ public class AdolescentAppController {
|
|||||||
return R.ok(vo);
|
return R.ok(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/switch")
|
@PostMapping("/switch")
|
||||||
@Operation(summary = "青少年模式开关")
|
@Operation(summary = "青少年模式开关")
|
||||||
@Log(title = "青少年模式开关", businessType = BusinessType.OTHER, isSaveDb = false)
|
@Log(title = "青少年模式开关", businessType = BusinessType.OTHER, isSaveDb = false)
|
||||||
public R<Void> switchAdolescent(@RequestBody AdolescentSwitch adolescentSwitch){
|
public R<Void> switchAdolescent(@RequestBody AdolescentSwitch adolescentSwitch){
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ public class AdolescentServiceImpl extends ServiceImpl<AdolescentMapper,Adolesce
|
|||||||
throw new ServiceException("参数不正确");
|
throw new ServiceException("参数不正确");
|
||||||
}
|
}
|
||||||
Adolescent adolescent = this.getByUserId(LoginHelper.getUserId());
|
Adolescent adolescent = this.getByUserId(LoginHelper.getUserId());
|
||||||
String hashpw = BCrypt.hashpw(adolescentSwitch.getPassword());
|
if(adolescent == null || !BCrypt.checkpw(adolescentSwitch.getPassword(), adolescent.getPassword())){
|
||||||
if(adolescent == null || !adolescent.getPassword().equals(hashpw)){
|
|
||||||
throw new ServiceException("密码错误");
|
throw new ServiceException("密码错误");
|
||||||
}
|
}
|
||||||
if(adolescentSwitch.getIsOpen() == 0){
|
if(adolescentSwitch.getIsOpen() == 0){
|
||||||
|
|||||||
Reference in New Issue
Block a user