修复上传按钮

This commit is contained in:
liaozetao
2023-11-20 18:34:13 +08:00
parent c5196494ea
commit 0356944be5

View File

@@ -212,34 +212,28 @@ export default {
uploadIcon() { uploadIcon() {
let $this = this; let $this = this;
let file = $('#iconFile').val(); let file = $('#iconFile').val();
console.log(file);
if (file && file.length > 0) { if (file && file.length > 0) {
showLoading(); showLoading();
$('#iconUploadBtn').click(function () { uploadFile('iconFile').then(res => {
uploadFile('iconFile').then(res => { if (res.path) {
if (res.path) { $this.resource.icon = res.path;
$this.resource.icon = res.path; $('#iconUploadInfo').html('上传成功');
$('#iconUploadInfo').html('上传成功'); }
} }).finally(() => {
}).finally(() => { hideLoading();
hideLoading();
});
}); });
} }
}, },
uploadUrl() { uploadUrl() {
let $this = this; let $this = this;
let file = $('#urlFile').val(); let file = $('#urlFile').val();
console.log(file);
if (file && file.length > 0) { if (file && file.length > 0) {
showLoading(); showLoading();
$('#urlUploadBtn').click(function () { uploadFile('urlFile').then(res => {
uploadFile('urlFile').then(res => { if (res.path) {
if (res.path) { $this.resource.url = res.path;
$this.resource.url = res.path; $('#urlUploadInfo').html('上传成功');
$('#urlUploadInfo').html('上传成功'); }
}
});
}).finally(() => { }).finally(() => {
hideLoading(); hideLoading();
}); });