From 9c061b84db2628441f881c37a1fafd530cadc7b7 Mon Sep 17 00:00:00 2001 From: leiyun Date: Mon, 19 May 2025 15:10:05 +0800 Subject: [PATCH] save dir bug --- src/home/controller/index.js | 42 +++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/home/controller/index.js b/src/home/controller/index.js index 07ec7d8..404d9df 100644 --- a/src/home/controller/index.js +++ b/src/home/controller/index.js @@ -234,30 +234,32 @@ export default class extends Base { await fs.copy(`${dir}/${domain}.crt`, `${dir2}/${domain}.crt`); await fs.copy(`${dir}/${domain}.key`, `${dir2}/${domain}.key`); } - } - //执行ssh copy - let SCP = this.config().SCP; - if (SCP && SCP.length > 0) { - for (let item of SCP) { - scp.scp( - `${dir}/${domain}.crt`, - { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.crt` }, - (err) => { - console.log('远程复制失败1:', err); - } - ); - scp.scp( - `${dir}/${domain}.key`, - { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.key` }, - (err) => { - console.log('远程复制失败2:', err); - } - ); - } + //执行ssh copy + let SCP = this.config().SCP; + if (SCP && SCP.length > 0) { + for (let item of SCP) { + scp.scp( + `${dir}/${domain}.crt`, + { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.crt` }, + (err) => { + console.log('远程复制失败1:', err); + } + ); + scp.scp( + `${dir}/${domain}.key`, + { host: item.host, username: item.user, password: item.password, path: `${dir2}/${domain}.key` }, + (err) => { + console.log('远程复制失败2:', err); + } + ); + } + } } + + // 2. 检查配置 execSync('nginx -t');