Initial commit

This commit is contained in:
jiapengyu
2026-07-27 13:37:48 +08:00
commit ecba71e2a5
39123 changed files with 5989154 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
import { Client } from 'ssh2';
const conn = new Client();
conn.on('ready', () => {
console.log('=== 测试后端API(不编码中文) ===\n');
console.log('1. 测试查询宁赜的订单(不编码):');
conn.exec('curl -s "http://localhost:4000/api/orders?collector=宁赜"', (err, stream) => {
if (err) { console.log('ERR:', err); conn.end(); return; }
let output = '';
stream.on('data', (d) => output += d.toString());
stream.on('close', () => {
try {
const result = JSON.parse(output);
console.log(`返回订单数: ${result.data?.length || 0}`);
if (result.data && result.data.length > 0) {
result.data.forEach(order => {
console.log(` - 订单${order.id}: collector=${order.collector}`);
});
}
} catch (e) {
console.log('输出:', output);
}
conn.end();
});
});
});
conn.on('error', (err) => {
console.log('连接错误:', err.message);
});
conn.connect({
host: 'hs.yifenbao.cn',
port: 22,
username: 'root',
password: 'Torch1112'
});