判断不允许重复发请求

This commit is contained in:
liaozetao
2023-11-20 14:51:52 +08:00
parent 14c2e701a0
commit 545a86ed54
2 changed files with 30 additions and 21 deletions

View File

@@ -210,25 +210,31 @@ export default {
methods: {
uploadIcon() {
let $this = this;
let file = $('#iconFile').val();
if (file) {
$('#iconUploadBtn').click(function () {
uploadFile('iconFile').then(res => {
if (res.path) {
$this.resource.icon = res.path;
$('#iconUploadInfo').val('上传成功');
$('#iconUploadInfo').html('上传成功');
}
});
});
}
},
uploadUrl() {
let $this = this;
let file = $('#urlFile').val();
if (file) {
$('#urlUploadBtn').click(function () {
uploadFile('urlFile').then(res => {
if (res.path) {
$this.resource.url = res.path;
$('#urlUploadInfo').val('上传成功');
$('#urlUploadInfo').html('上传成功');
}
});
});
}
},
getRule() {
getResourceRuleList({

View File

@@ -175,14 +175,17 @@ export default {
methods: {
uploadUrl() {
let $this = this;
let file = $('#urlFile').val();
if (file) {
$('#urlUploadBtn').click(function () {
uploadFile('urlFile').then(res => {
if (res.path) {
$this.resource.url = res.path;
$('#urlUploadInfo').val('上传成功');
$('#urlUploadInfo').html('上传成功');
}
});
});
}
},
getRule() {
getResourceRuleList({