aixxai 1.6.5 → 1.6.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/install.js +17 -1
package/package.json
CHANGED
package/src/commands/install.js
CHANGED
|
@@ -500,8 +500,24 @@ export async function install(subArgs) {
|
|
|
500
500
|
|
|
501
501
|
// 7.5 裸注册:装即给身份(K哥方案1010——编号+随机密码,充值/个人中心天然归账)
|
|
502
502
|
try {
|
|
503
|
+
// 卡179-a: 先用设备bid取开通码(设备指纹=hostname+型号+核数哈希, 同机同码) — 桥端已要求持码
|
|
504
|
+
const os = await import('os');
|
|
505
|
+
const rawFp = os.hostname() + '|' + os.platform() + '|' + os.arch() + '|' + os.cpus().length + '|' + (os.totalmem() || 0);
|
|
506
|
+
let h = 0; for (let i = 0; i < rawFp.length; i++) { h = ((h << 5) - h) + rawFp.charCodeAt(i); h |= 0; }
|
|
507
|
+
const devBid = 'fp' + Math.abs(h).toString(36) + String(rawFp.length).toString(36);
|
|
508
|
+
let openCode = '';
|
|
509
|
+
try {
|
|
510
|
+
const bcResp = await fetch('https://console.aixx.ai/cloudpay/bindcode/new', {
|
|
511
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
512
|
+
body: JSON.stringify({ bid: devBid, src: 'cli-install' }),
|
|
513
|
+
signal: AbortSignal.timeout(15000),
|
|
514
|
+
});
|
|
515
|
+
const bcJ = await bcResp.json();
|
|
516
|
+
if (bcJ && bcJ.ok && bcJ.code) openCode = bcJ.code;
|
|
517
|
+
} catch (e) {}
|
|
503
518
|
const nr = await fetch('https://console.aixx.ai/bridge/naked/register', {
|
|
504
|
-
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
519
|
+
method: 'POST', headers: { 'Content-Type': 'application/json' },
|
|
520
|
+
body: JSON.stringify(openCode ? { code: openCode } : {}),
|
|
505
521
|
signal: AbortSignal.timeout(15000),
|
|
506
522
|
});
|
|
507
523
|
const nj = await nr.json();
|