调试上传逻辑
This commit is contained in:
parent
f8ab0d9ebb
commit
cc81fe7cec
|
|
@ -43,6 +43,7 @@ layui.use(["table", "form", "upload", "tree"], function () {
|
||||||
$("#uploadBtn").on("click", function () {
|
$("#uploadBtn").on("click", function () {
|
||||||
$("#fileInput").click();
|
$("#fileInput").click();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 让点击上传按钮触发文件输入框的点击事件
|
// 让点击上传按钮触发文件输入框的点击事件
|
||||||
$("#uploadBtn1").on("click", function () {
|
$("#uploadBtn1").on("click", function () {
|
||||||
$("#fileInput1").click();
|
$("#fileInput1").click();
|
||||||
|
|
@ -86,6 +87,23 @@ layui.use(["table", "form", "upload", "tree"], function () {
|
||||||
} else {
|
} else {
|
||||||
$("#fileInfo1").html("选中的文件:" + fileName);
|
$("#fileInfo1").html("选中的文件:" + fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
formData.append("file", file);
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: ctxPath + "/organizational/uploadInfo",
|
||||||
|
type: "POST",
|
||||||
|
data: formData,
|
||||||
|
processData: false, // 告诉jQuery不要处理数据
|
||||||
|
contentType: false,
|
||||||
|
success: function (res) {
|
||||||
|
console.log(res, "上传成功");
|
||||||
|
},
|
||||||
|
error: function (err) {
|
||||||
|
console.error(err);
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
// 初始化下拉框
|
// 初始化下拉框
|
||||||
getOutSourceSelected();
|
getOutSourceSelected();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue