瀏覽代碼

大小限制调整

laiguoran 2 年之前
父節點
當前提交
47736795bc
共有 1 個文件被更改,包括 4 次插入4 次删除
  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);