mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
fix: ck提示;抽卡记录
This commit is contained in:
parent
d6ab61fe5a
commit
4ed3555f33
4 changed files with 30 additions and 19 deletions
|
|
@ -50,27 +50,31 @@ export class ZZZPlugin extends plugin {
|
|||
return false;
|
||||
}
|
||||
|
||||
// 创建米游社 API 对象
|
||||
const api = new MysZZZApi(uid, ck);
|
||||
// 获取设备指纹
|
||||
let deviceFp = await redis.get(`ZZZ:DEVICE_FP:${uid}`);
|
||||
if (!deviceFp) {
|
||||
const sdk = api.getUrl('getFp');
|
||||
const res = await fetch(sdk.url, {
|
||||
headers: sdk.headers,
|
||||
method: 'POST',
|
||||
body: sdk.body,
|
||||
});
|
||||
const fpRes = await res.json();
|
||||
deviceFp = fpRes?.data?.device_fp;
|
||||
if (deviceFp) {
|
||||
await redis.set(`ZZZ:DEVICE_FP:${uid}`, deviceFp, {
|
||||
EX: 86400 * 7,
|
||||
try {
|
||||
// 创建米游社 API 对象
|
||||
const api = new MysZZZApi(uid, ck);
|
||||
// 获取设备指纹
|
||||
let deviceFp = await redis.get(`ZZZ:DEVICE_FP:${uid}`);
|
||||
if (!deviceFp) {
|
||||
const sdk = api.getUrl('getFp');
|
||||
const res = await fetch(sdk.url, {
|
||||
headers: sdk.headers,
|
||||
method: 'POST',
|
||||
body: sdk.body,
|
||||
});
|
||||
const fpRes = await res.json();
|
||||
deviceFp = fpRes?.data?.device_fp;
|
||||
if (deviceFp) {
|
||||
await redis.set(`ZZZ:DEVICE_FP:${uid}`, deviceFp, {
|
||||
EX: 86400 * 7,
|
||||
});
|
||||
}
|
||||
}
|
||||
// 返回数据(API、UID、设备指纹)
|
||||
return { api, uid, deviceFp };
|
||||
} catch (error) {
|
||||
this.reply(error.message);
|
||||
}
|
||||
// 返回数据(API、UID、设备指纹)
|
||||
return { api, uid, deviceFp };
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue