diff --git a/src/pages/Submit/Submit.vue b/src/pages/Submit/Submit.vue index 53cd9f8..0912af1 100644 --- a/src/pages/Submit/Submit.vue +++ b/src/pages/Submit/Submit.vue @@ -21,7 +21,7 @@
您的提交已经被打回 可再次提交
" + this.loading = false + }else if (res.data.status == 0){ + // 已提交,不可再次提交 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + this.uploadMessage="您已经提交作品,如有问题请联系管理员
" + + //设置上传状态 + this.uploadStatus = true + this.loading = false + } + }else if (this.submitPerDay == -1){ + //无限次 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + this.uploadMessage="您已经提交作品,再次提交作品将会覆盖
" + this.loading = false + }else { + //可提交指定次数 + if (res.data.status < this.submitPerDay){ + //已提交次数 小于当日可提交次数 可以再次提交 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + var num = this.submitPerDay - res.data.status + this.uploadMessage="您已经提交作品,本日还有"+ num + "次提交机会
" + this.loading = false + }else{ + //不可再次提交 + this.fileList.push({ + name: res.data.file.split("/")[3], + url: res.data.file + } + ) + this.uploadMessage="您已经提交作品,本日提交机会已用尽" + + //设置上传状态 + this.uploadStatus = true + this.loading = false + } + } + // res.data.status == 0 - //设置上传状态 - this.uploadStatus = true - this.loading = false } else if (res.status == 10) { // 没有提交信息 this.loading = false diff --git a/src/utils/http/interface.js b/src/utils/http/interface.js index dca3713..fe22851 100644 --- a/src/utils/http/interface.js +++ b/src/utils/http/interface.js @@ -271,6 +271,18 @@ export const getSubmitInfo = (data) => { }) }; + +export const insertSubmitInfo = (data) => { + return axios({ + headers:{ + "Authorization": localStorage.getItem("systemToken") + }, + url: '/submit/insertSubmitInfo', + method: 'post', + data + }) +}; + // 默认全部倒出 // 根据需要进行 export default { @@ -298,5 +310,6 @@ export default { updateApplyInfo, getDivisionAndKind, getSubmitCust, - getSubmitInfo + getSubmitInfo, + insertSubmitInfo } \ No newline at end of file