默认路径没有获取到

This commit is contained in:
aixianling
2024-10-18 09:28:54 +08:00
parent 6532b66240
commit e394e4d2ba

View File

@@ -61,7 +61,8 @@ const handleZip = (id, ws) => {
const {signal} = controller; const {signal} = controller;
const progress = new counter(`正在处理 ${info.name} 的打包工作...`) const progress = new counter(`正在处理 ${info.name} 的打包工作...`)
if (info.type == 'web') { if (info.type == 'web') {
const {name, version, dist = `${name}_v${version}`} = info let {name, version, dist} = info
dist = dist?.trim() || `${name}_v${version}`
const buildConfig = { const buildConfig = {
web: {task: "devops-web", token: 'fLeOGSVIRs405Me'}, web: {task: "devops-web", token: 'fLeOGSVIRs405Me'},
}[info.type] }[info.type]
@@ -69,7 +70,7 @@ const handleZip = (id, ws) => {
.then(() => progress.set(30, id)) .then(() => progress.set(30, id))
.then(() => http.get(`/view/devops/job/${buildConfig.task}/buildWithParameters`, .then(() => http.get(`/view/devops/job/${buildConfig.task}/buildWithParameters`,
{params: {token: buildConfig.token, pid: id, dist}})) {params: {token: buildConfig.token, pid: id, dist}}))
.then(() => http.get(`/view/devops/job/${buildConfig.task}/api/json`).then(res => res.data.lastBuild.number)) .then(() => http.get(`/view/devops/job/${buildConfig.task}/api/json`).then(res => res.data?.lastBuild.number||1))
.then(currentJob => new Promise((resolve, reject) => { .then(currentJob => new Promise((resolve, reject) => {
jobs[id] = {task: buildConfig.task, build: currentJob} jobs[id] = {task: buildConfig.task, build: currentJob}
const timer = setInterval(() => { const timer = setInterval(() => {
@@ -77,10 +78,10 @@ const handleZip = (id, ws) => {
if (res.data.result == 'SUCCESS') { if (res.data.result == 'SUCCESS') {
clearInterval(timer) clearInterval(timer)
resolve(endUpdateSql()) resolve(endUpdateSql())
} else if (res.data.res == 'ABORTED') { } else if (res.data.result == 'ABORTED') {
clearInterval(timer) clearInterval(timer)
reject("构建取消") reject("构建取消")
} else if (res.data.res == 'FAILURE') { } else if (res.data.result == 'FAILURE') {
clearInterval(timer) clearInterval(timer)
reject("构建失败") reject("构建失败")
} }