diff --git a/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue b/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue index 54430373..c4e12b61 100644 --- a/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue +++ b/project/oms/apps/develop/AppDeployWxmp/AppDeployWxmp.vue @@ -31,7 +31,8 @@ @@ -113,7 +114,8 @@ export default { // privateKey: {required: true, message: "请输入 小程序上传私钥"}, // projectPath: {required: true, message: "请输入 项目地址"}, version: {required: true, message: "请选择 定制方案"}, - } + }, + timer: {} } }, methods: { @@ -155,15 +157,15 @@ export default { }).then(res => { if (res?.code == 0) { row.count = 1 - let timer = setInterval(() => { + this.timer[id] = setInterval(() => { if (row.count >= 100) { - clearInterval(timer) + clearInterval(this.timer[id]) this.$message.error("打包失败!") } else if (row.count <= 25) { row.count++ } else this.handleConfirmZip(row).then(v => { if (v.error) { - clearInterval(timer) + clearInterval(this.timer[id]) row.error = v.error row.count = 0 } else row.count++ @@ -172,6 +174,10 @@ export default { } }).catch(() => this.$message.error("打包失败!")) }, + handleCancelZip(row) { + clearInterval(this.timer[row.id]) + row.count = 0 + }, handleUpdateSystem(row) { let {appid} = row return this.instance.post("/node/wxmp/updateSystem", null, { @@ -225,6 +231,9 @@ export default { }, created() { this.getTableData() + }, + beforeDestroy() { + Object.values(this.timer).map(t => clearInterval(t)) } }