Ver código fonte

多签章数控制

laiguoran 2 anos atrás
pai
commit
aecb35f65b
1 arquivos alterados com 3 adições e 2 exclusões
  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) {