一、说明
1、jquery
2、ajax
3、ruoyi封装好的ruoyi-fast单体项目
4、场景需要上传文件的同时,上传其他业务参数
二、代码示例
$(".file-upload").fileinput({
uploadUrl: ctx + 'common/uploadDiffer',
maxFileCount: 1,
autoReplace: true,
uploadExtraData:function(){//向后台传递参数
var data = {
versionDir: $("#fromVersion").val() + "_" + $("#toVersion").val()
};
return data;
}
}).on('fileuploaded', function (event, data, previewId, index) {
$("input[name='" + event.currentTarget.id + "']").val(data.response.url)
}).on('fileremoved', function (event, id, index) {
$("input[name='" + event.currentTarget.id + "']").val('')
})
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)