Browse Source

使用弹窗显示上传失败的原因

UnknownO 3 years ago
parent
commit
658aacbfdd
1 changed files with 8 additions and 4 deletions
  1. 8 4
      pages/submit.php

+ 8 - 4
pages/submit.php

@@ -93,10 +93,14 @@ if ($templateMode) {
                         $("#isLoading").hide(100)
                         $("#isLoading").hide(100)
                         $("#image").val(rdata.path)
                         $("#image").val(rdata.path)
                         $('#upload-image').removeAttr("disabled")
                         $('#upload-image').removeAttr("disabled")
-                        mdui.snackbar({
-                            message: rdata.msg,
-                            position: 'right-top',
-                        })
+                        if (rdata.code == 1) {
+                            mdui.snackbar({
+                                message: rdata.msg,
+                                position: 'right-top',
+                            })
+                        } else {
+                            mdui.alert(rdata.msg)
+                        }
                     },
                     },
                     error: function(data) {
                     error: function(data) {
                         $("#image").val("")
                         $("#image").val("")