上传过滤图片

pull/30/head
taoshihan1991 4 years ago
parent 369a9d7ad4
commit cf069f3723

@ -579,7 +579,7 @@
//上传图片
uploadImg (url){
let _this=this;
$('#uploadImg').after('<input type="file" id="uploadImgFile" name="file" style="display:none" >');
$('#uploadImg').after('<input type="file" accept="image/gif,image/jpeg,image/jpg,image/png" id="uploadImgFile" name="file" style="display:none" >');
$("#uploadImgFile").click();
$("#uploadImgFile").change(function (e) {
var formData = new FormData();

@ -442,7 +442,7 @@
//上传图片
uploadImg (url){
let _this=this;
$('#uploadImg').after('<input type="file" id="uploadImgFile" name="file" style="display:none" >');
$('#uploadImg').after('<input type="file" accept="image/gif,image/jpeg,image/jpg,image/png" id="uploadImgFile" name="file" style="display:none" >');
$("#uploadImgFile").click();
$("#uploadImgFile").change(function (e) {
var formData = new FormData();

@ -84,7 +84,7 @@ function replaceContent (content) {// 转义聊天内容中的特殊字符
}
function filter (obj){
var imgType = ["image/jpeg","image/png","image/jpg"];
var imgType = ["image/jpeg","image/png","image/jpg","image/gif"];
var filetypes = imgType;
var isnext = false;
for (var i = 0; i < filetypes.length; i++) {

Loading…
Cancel
Save