|
|
@@ -132,7 +132,7 @@ public class CmsAccountController {
|
|
|
if (StrUtil.isNotBlank(data.getAccount())) {
|
|
|
Account account = accountService.getOne(Wrappers.lambdaQuery(Account.class)
|
|
|
.eq(Account::getGoodsId, goodsId)
|
|
|
- .eq(Account::getAccount, data.getAccount()));
|
|
|
+ .eq(Account::getAccount, data.getAccount().trim()));
|
|
|
Boolean flag = false;
|
|
|
if (account != null) {
|
|
|
if (data.getExpiryTime() != null) {
|
|
|
@@ -162,12 +162,20 @@ public class CmsAccountController {
|
|
|
|
|
|
@PostMapping("/post")
|
|
|
public Result<String> add(@RequestBody Account account){
|
|
|
+ account.setAccount(account.getAccount().trim());
|
|
|
+ account.setPassword(account.getPassword().trim());
|
|
|
accountService.save(account);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
|
|
|
@PutMapping("/update")
|
|
|
public Result<String> update(@RequestBody Account account){
|
|
|
+ if (StrUtil.isNotBlank(account.getAccount())){
|
|
|
+ account.setAccount(account.getAccount().trim());
|
|
|
+ }
|
|
|
+ if (StrUtil.isNotBlank(account.getPassword())){
|
|
|
+ account.setPassword(account.getPassword().trim());
|
|
|
+ }
|
|
|
accountService.updateById(account);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|