bug--修复新增产品不选分类报错以及去掉ip2region

This commit is contained in:
taochengbo
2020-05-24 17:04:20 +08:00
committed by xuwenbo
parent 3dcb3bca99
commit aa6c2c622a
2 changed files with 3 additions and 0 deletions

View File

@ -135,6 +135,9 @@ public class YxStoreProductServiceImpl extends BaseServiceImpl<StoreProductMappe
@Override
public YxStoreProduct saveProduct(YxStoreProduct storeProduct) {
if (storeProduct.getStoreCategory().getId() == null) {
throw new BadRequestException("分类名称不能为空");
}
storeProduct.setCateId(storeProduct.getStoreCategory().getId().toString());
this.save(storeProduct);
return storeProduct;