Procházet zdrojové kódy

多签章数控制

laiguoran před 2 roky
rodič
revize
aecb35f65b
1 změnil soubory, kde provedl 3 přidání a 2 odebrání
  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) {