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
+23
View File
@@ -0,0 +1,23 @@
const { Client } = require('ssh2');
const conn = new Client();
conn.on('ready', () => {
console.log('=== 删除旧数据文件 ===');
conn.exec('rm -rf /www/huishou/server/data/admin.json && cd /www/huishou && docker-compose down && docker-compose build --no-cache backend && docker-compose up -d', (err, stream) => {
if (err) { console.log('ERR:', err); conn.end(); return; }
stream.on('data', (d) => console.log(d.toString()));
stream.on('close', () => {
setTimeout(() => {
console.log('\n=== 测试管理员登录 ===');
conn.exec('curl -s -X POST http://127.0.0.1:4000/api/admin/login -H "Content-Type: application/json" -d \'{"phone":"18698102228","password":"123456"}\'', (err2, stream2) => {
if (err2) { console.log('ERR2:', err2); conn.end(); return; }
stream2.on('data', (d) => console.log(d.toString()));
stream2.on('close', () => conn.end());
});
}, 5000);
});
});
});
conn.connect({ host: 'hs.yifenbao.cn', port: 22, username: 'root', password: 'Torch1112' });