Browse Source

修改图片管理

Wang-Xiao-Ran 1 year ago
parent
commit
6bf885cce7
1 changed files with 12 additions and 8 deletions
  1. 12 8
      src/views/my/jnbImg.vue

+ 12 - 8
src/views/my/jnbImg.vue

@@ -268,14 +268,18 @@ export default {
       let flag = true;
       //如果图片类型为封面图片, 切图片状态为开, 则查询后台是否存在图片状态为开的数据, 不存在返回true, 存在返回false
       if (this.form.imgType === "1" && this.form.imgSwitch === "switch_on") {
-        isCover().then(res => {
-          if (res.data) {
-            flag = false;
-            this.$modal.msgError("封面图片只能存在一张, 请先关闭其他封面图片");
-          }else{
-            this.isSubmit();
-          }
-        })
+        if(this.form.id != null){
+          this.isSubmit();
+        }else{
+          isCover().then(res => {
+            if (res.data) {
+              flag = false;
+              this.$modal.msgError("封面图片只能存在一张, 请先关闭其他封面图片");
+            }else{
+              this.isSubmit();
+            }
+          })
+        }
       }else{
         this.isSubmit();
       }