fix:设备信息

This commit is contained in:
kissnavel 2024-09-22 00:48:04 +08:00
parent 7f27bbf332
commit d6e52b1a24
8 changed files with 49 additions and 14 deletions

View file

@ -80,10 +80,7 @@ export class ZZZPlugin extends plugin {
handler: this.e?.runtime?.handler || {},
e: this.e,
});
const currentCK = Object.values(ck).find(item => {
return item.ck && item.uid === uid;
});
const ltuid = currentCK?.ltuid || '';
const ltuid = await this.getLtuid();
if (!ltuid) {
this.reply('ltuid为空请重新绑定CK');
throw new Error('ltuid为空');
@ -103,6 +100,7 @@ export class ZZZPlugin extends plugin {
deviceType: bindInfo?.deviceName,
modelName: bindInfo?.deviceModel,
oaid: bindInfo?.oaid,
osVersion: bindInfo?.androidVersion,
deviceInfo: bindInfo?.deviceFingerprint,
board: bindInfo?.deviceBoard,
};
@ -150,7 +148,7 @@ export class ZZZPlugin extends plugin {
}
}
} else {
deviceFp = await redis.get(`ZZZ:DEVICE_FP:${uid}`);
deviceFp = await redis.get(`ZZZ:DEVICE_FP:${uid}:FP`);
if (!deviceFp) {
const sdk = api.getUrl('getFp');
const res = await request(sdk.url, {
@ -161,7 +159,7 @@ export class ZZZPlugin extends plugin {
const fpRes = await res.json();
deviceFp = fpRes?.data?.device_fp;
if (deviceFp) {
await redis.set(`ZZZ:DEVICE_FP:${uid}`, deviceFp, {
await redis.set(`ZZZ:DEVICE_FP:${uid}:FP`, deviceFp, {
EX: 86400 * 7,
});
}