Initial commit - full huishou project

This commit is contained in:
jiapengyu
2026-07-27 14:07:26 +08:00
commit 60790ad1b3
39127 changed files with 5989265 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
const { Client } = require('ssh2');
const config = {
host: 'hs.yifenbao.cn',
port: 22,
username: 'root',
password: 'Torch1112'
};
const conn = new Client();
conn.on('ready', () => {
console.log('SSH连接成功');
conn.sftp((err, sftp) => {
if (err) {
console.error('SFTP连接失败:', err.message);
conn.end();
return;
}
sftp.fastPut('./dist/build/h5/assets/pages-index-index.Dfg3o6TQ.js', '/www/huishou/dist/build/h5/assets/pages-index-index.Dfg3o6TQ.js', (err) => {
if (err) {
console.error('文件上传失败:', err.message);
conn.end();
return;
}
console.log('文件上传成功');
conn.exec('docker restart huishou', (err, stream) => {
stream.on('close', () => {
console.log('容器已重启');
conn.end();
});
});
});
});
});
conn.on('error', (err) => {
console.error('SSH连接错误:', err.message);
});
conn.connect(config);