wx.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: function (res) {
self.previewImage = res.localIds.toString();
// 上传微信选择图片
wx.uploadImage({
localId: self.previewImage,
isShowProgressTips: 1,
success: function (res) {
self.mediaId = res.serverId;
}
},0);
}
});
我输出了一下 选择图片和上传图片 成功返回的res
就只有serverId、errMsg、sourceType、localIds
没有什么字段是能标识图片类型的
那么,前端要怎么做图片类型限制呢?
想做这个限制是因为,用户上传了webp格式的图片,然后iPhone显示不出来,
虽然后端可以做(需要做个php扩展),但是前端也想做限制。
谢谢!!