@@ -115,7 +115,7 @@ $(document).ready(function() {
115
115
language: 'zh',
116
116
dropZoneEnabled: true,
117
117
browseOnZoneClick: true,
118
- dropZoneTitle: "拖拽文件到这里 ...",
118
+ dropZoneTitle: "拖拽或粘贴文件到这里 ...",
119
119
dropZoneClickTitle: "",
120
120
browseClass: "btn btn-light",
121
121
uploadClass: "btn btn-light",
@@ -135,7 +135,7 @@ $(document).ready(function() {
135
135
136
136
switch (selectedInterface) {
137
137
case 'tg':
138
- acceptTypes = 'image/gif,image/jpeg,image/png';
138
+ acceptTypes = 'image/gif,image/jpeg,image/jpg,image/ png,video/mp4 ';
139
139
break;
140
140
}
141
141
$('#fileInput').attr('accept', acceptTypes);
@@ -169,17 +169,17 @@ $(document).ready(function() {
169
169
}
170
170
});
171
171
172
- // 处理上传文件函数
172
+ // 处理上传文件函数
173
173
async function uploadFile(file) {
174
174
try {
175
- if (file.type === 'image/gif') {
175
+ if (file.type === 'image/gif' || file.type === 'video/mp4' ) {
176
176
if (file.size > 5 * 1024 * 1024) {
177
- toastr.error('GIF 文件必须≤5MB');
177
+ toastr.error('文件必须≤5MB');
178
178
return;
179
179
}
180
180
} else {
181
181
const compressedFile = await compressImage(file);
182
- file = compressedFile; // 如果不是GIF ,使用压缩后的文件
182
+ file = compressedFile; // 如果不是GIF或视频 ,使用压缩后的文件
183
183
}
184
184
185
185
$('#uploadingText').show();
@@ -196,7 +196,7 @@ $(document).ready(function() {
196
196
} finally {
197
197
$('#uploadingText').hide();
198
198
}
199
- }
199
+ }
200
200
201
201
//处理图片压缩事件
202
202
async function compressImage(file, quality = 0.5, maxResolution = 20000000) {
0 commit comments