Explorar el Código

多签章数控制

laiguoran hace 2 años
padre
commit
aecb35f65b
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      app/public/js/profile.js

+ 3 - 2
app/public/js/profile.js

@@ -168,11 +168,12 @@ $(document).ready(function() {
 
         // 上传签章
         $('#stamp-upload').change(function () {
-            if ($('#show-stamp .stamp-show').length >= 5) {
+            const hadstamp = $('#show-stamp .stamp-show').length;
+            const files = this.files;
+            if (hadstamp + files.length >= 5) {
                 toastr.error('最多只能5个签章');
                 return
             }
-            const files = this.files;
             const formData = new FormData();
             for (const file of files) {
                 if (file === undefined) {