浏览代码

上传头图空校验

李亚非 3 月之前
父节点
当前提交
89cb0fca94
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      alien-store/src/main/java/shop/alien/store/controller/StoreImgController.java

+ 3 - 1
alien-store/src/main/java/shop/alien/store/controller/StoreImgController.java

@@ -77,7 +77,9 @@ public class StoreImgController {
         if (storeImgInfoVo.getStoreId()==null || storeImgInfoVo.getImgType()==null) {
         if (storeImgInfoVo.getStoreId()==null || storeImgInfoVo.getImgType()==null) {
             return R.fail("失败");
             return R.fail("失败");
         }
         }
-        
+        if(storeImgInfoVo.getStoreImgList().isEmpty()){
+            return R.fail("图片列表为空,请重新上传图片");
+        }
         // 判断是否是头图(20:单图模式, 21:多图模式)
         // 判断是否是头图(20:单图模式, 21:多图模式)
         Integer imgType = storeImgInfoVo.getImgType();
         Integer imgType = storeImgInfoVo.getImgType();
         boolean isHeadImage = (imgType == 20 || imgType == 21);
         boolean isHeadImage = (imgType == 20 || imgType == 21);