From 8851f2703ad90f44bb1766c3501ff412db4ad908 Mon Sep 17 00:00:00 2001 From: aixianling Date: Fri, 18 Oct 2024 11:21:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E5=AE=B9=E5=99=A8=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E5=90=8E,=E8=B0=83=E6=95=B4=E6=89=80=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/rest/autodeploy/download.js | 4 ++-- src/rest/custom/download.js | 4 ++-- src/rest/wechat/download.js | 4 ++-- src/rest/wechat/getZip.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rest/autodeploy/download.js b/src/rest/autodeploy/download.js index 1efb0a9..b1b18df 100644 --- a/src/rest/autodeploy/download.js +++ b/src/rest/autodeploy/download.js @@ -9,13 +9,13 @@ module.exports = { dbUtils.query(sql).then(res => { let info = res?.[0] if (info?.id) { - let path = `${info.target}`, zipPath = `/home/deploy/node-service/zips/${info.id}.zip` + let path = `${info.target}`, zipPath = `/zips/${info.id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) if (exists) { execute(`cd ${path}&&zip -r ${info.id}.zip .`) - .then(() => execute(`cd ${path}&&mv ${info.id}.zip /home/deploy/node-service/zips`)) + .then(() => execute(`cd ${path}&&mv ${info.id}.zip /zips`)) .then(() => { console.log('压缩完成!') setTimeout(() => { diff --git a/src/rest/custom/download.js b/src/rest/custom/download.js index 2a0b973..299b9d0 100644 --- a/src/rest/custom/download.js +++ b/src/rest/custom/download.js @@ -8,13 +8,13 @@ module.exports = { let id = request.query?.id dbUtils.detail({table: 'node_custom_config', id}).then(info => { if (info?.id) { - let path = `${info.dist || `../zips/${info.name}v${info.version}`}`, zipPath = `../zips/${info.id}.zip` + let path = `${info.dist || `/zips/${info.name}v${info.version}`}`, zipPath = `/zips/${info.id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) if (exists) { execute(`cd ${path}&&zip -r ${info.id}.zip .`) - .then(() => execute(`cd ${path}&&mv ${info.id}.zip /home/deploy/node_deploy/zips/`)) + .then(() => execute(`cd ${path}&&mv ${info.id}.zip /zips/`)) .then(() => { console.log('压缩完成!') setTimeout(() => { diff --git a/src/rest/wechat/download.js b/src/rest/wechat/download.js index 452a34d..034972d 100644 --- a/src/rest/wechat/download.js +++ b/src/rest/wechat/download.js @@ -6,13 +6,13 @@ module.exports = { execute: (request, response) => { let {id} = request.query if (id) { - let path = `/home/deploy/node_deploy/zips/${id}/`, zipPath = `/home/deploy/node_deploy/zips/${id}.zip` + let path = `/zips/${id}/`, zipPath = `/zips/${id}.zip` fse.removeSync(zipPath) fse.pathExists(path, (err, exists) => { console.log(`${path}=========>${exists}`) if (exists) { execute(`cd ${path}&&zip -r ${id}.zip .`) - .then(() => execute(`cd ${path}&&mv ${id}.zip /home/deploy/node_deploy/zips`)) + .then(() => execute(`cd ${path}&&mv ${id}.zip /zips`)) .then(() => { console.log('压缩完成!') setTimeout(() => { diff --git a/src/rest/wechat/getZip.js b/src/rest/wechat/getZip.js index 74df7b4..5d610de 100644 --- a/src/rest/wechat/getZip.js +++ b/src/rest/wechat/getZip.js @@ -16,8 +16,8 @@ module.exports = { db.query(sql).then(() => setTimeout(() => { response.send({code: 0}) }, 2000)) - const path = info.projectPath || (isDev ? 'E:\\code\\cunwei\\dvcp_v2_wechat' : '/home/deploy/node_deploy/dvcp_v2_wechat'), - dest = (isDev ? `E:\\wxmpZips\\${id}` : `/home/deploy/node_deploy/zips/${id}/`), + const path = info.projectPath || (isDev ? 'E:\\code\\cunwei\\dvcp_v2_wechat' : '/dvcp_v2_wechat'), + dest = (isDev ? `E:\\wxmpZips\\${id}` : `/zips/${id}/`), processEnv = info.npmScript || 'build', dist = info.npmScript ? `${path}/dist/${info.npmScript}/` : `${path}/dist/build/mp-weixin/` execute(`cd ${path}&&npm run apps&&node bin/pages.js ${appid} ${id}&&npm run ${processEnv}`)