Selaa lähdekoodia

大小限制调整

laiguoran 2 vuotta sitten
vanhempi
commit
47736795bc
1 muutettua tiedostoa jossa 4 lisäystä ja 4 poistoa
  1. 4 4
      app/public/js/profile.js

+ 4 - 4
app/public/js/profile.js

@@ -145,8 +145,8 @@ $(document).ready(function() {
         $('#sign-upload').change(function () {
             const file = this.files[0];
             const filesize = file.size;
-            if (filesize > 1 * 1024 * 1024) {
-                toastr.error('上传的文件大小不能超过1MB!');
+            if (filesize > 0.5 * 1024 * 1024) {
+                toastr.error('上传的文件大小不能超过512KB!');
                 return false;
             }
             const ext = file.name.toLowerCase().split('.').splice(-1)[0];
@@ -187,8 +187,8 @@ $(document).ready(function() {
                     return
                 }
                 const filesize = file.size;
-                if (filesize > 1 * 1024 * 1024) {
-                    toastr.error('上传的文件大小不能超过1MB!');
+                if (filesize > 0.5 * 1024 * 1024) {
+                    toastr.error('上传的文件大小不能超过512KB!');
                     return false;
                 }
                 formData.append('file[]', file);