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
+58
View File
@@ -0,0 +1,58 @@
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.exec('docker exec huishou ls -la /usr/share/nginx/html/h5/assets/ | head -30', (err, stream) => {
if (err) {
console.error('执行命令错误:', err.message);
conn.end();
return;
}
let output = '';
stream.stdout.on('data', (data) => {
output += data.toString();
});
stream.on('close', () => {
console.log('容器内h5/assets文件列表:');
console.log(output);
// 检查文件大小
conn.exec('docker exec huishou ls -la /usr/share/nginx/html/h5/assets/pages-index-index*', (err, stream) => {
if (err) {
console.error('执行命令错误:', err.message);
conn.end();
return;
}
let fileOutput = '';
stream.stdout.on('data', (data) => {
fileOutput += data.toString();
});
stream.on('close', () => {
console.log('\n首页文件详情:');
console.log(fileOutput);
conn.end();
});
});
});
});
});
conn.on('error', (err) => {
console.error('SSH连接错误:', err.message);
});
conn.connect(config);