|
|
@@ -40,8 +40,8 @@ public class AppAccountController {
|
|
|
public R login(@RequestBody Account account) throws ServiceException {
|
|
|
|
|
|
Account user = accountService.getOne(new QueryWrapper<Account>().lambda().eq(Account::getPhone, account.getPhone()));
|
|
|
- Assert.isNull(user,() ->{throw new ServiceException(ResCode.USER_NOT_FOUNT);});
|
|
|
- Assert.isFalse(Objects.equals(user.getSecret(), DigestUtil.hex(account.getSecret())),() -> {
|
|
|
+ Assert.notNull(user,() ->{throw new ServiceException(ResCode.USER_NOT_FOUNT);});
|
|
|
+ Assert.isTrue(Objects.equals(user.getSecret(), DigestUtil.hex(account.getSecret())),() -> {
|
|
|
throw new ServiceException(ResCode.USER_PWS_ERROR);
|
|
|
});
|
|
|
return R.data(user);
|
|
|
@@ -52,17 +52,18 @@ public class AppAccountController {
|
|
|
@SneakyThrows
|
|
|
public R register(@RequestBody AppAccountDto appAccountDto) {
|
|
|
|
|
|
- Assert.isFalse(SmsUtil.validateMessage(null,appAccountDto.getSmsId(),appAccountDto.getValue(),appAccountDto.getPhone()),()->{
|
|
|
+ Assert.isTrue(SmsUtil.validateMessage(null,appAccountDto.getSmsId(),appAccountDto.getValue(),appAccountDto.getPhone()),()->{
|
|
|
throw new ServiceException(ResCode.VALIDATE_FAIL);
|
|
|
});
|
|
|
Account account = new Account();
|
|
|
BeanUtil.copyProperties(appAccountDto,account);
|
|
|
account.setSecret(DigestUtil.hex(account.getSecret()));
|
|
|
- Assert.isFalse(accountService.saveOrUpdate(account),()->{
|
|
|
+ Assert.isTrue(accountService.saveOrUpdate(account),()->{
|
|
|
throw new ServiceException(ResCode.SHOP_REGISTER_ERROR);
|
|
|
});
|
|
|
|
|
|
return R.data(account);
|
|
|
|
|
|
}
|
|
|
+
|
|
|
}
|