mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
👀👀
This commit is contained in:
parent
4a54442fae
commit
14f24bbd4d
4 changed files with 150 additions and 27 deletions
|
|
@ -56,7 +56,7 @@ export class ZZZPlugin extends plugin {
|
|||
// 创建米游社 API 对象
|
||||
const api = new MysZZZApi(uid, ck);
|
||||
// 获取设备指纹
|
||||
let deviceFp = await redis.get(`ZZZ:DEVICE_FP:${uid}`);
|
||||
let deviceFp = await redis.get(`ZZZ:DEVICE_FP:${uid}:FP`);
|
||||
if (!deviceFp) {
|
||||
const sdk = api.getUrl('getFp');
|
||||
const res = await fetch(sdk.url, {
|
||||
|
|
@ -65,9 +65,10 @@ export class ZZZPlugin extends plugin {
|
|||
body: sdk.body,
|
||||
});
|
||||
const fpRes = await res.json();
|
||||
logger.debug(`[米游社][设备指纹]${JSON.stringify(fpRes)}`);
|
||||
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,
|
||||
});
|
||||
}
|
||||
|
|
@ -86,10 +87,12 @@ export class ZZZPlugin extends plugin {
|
|||
*/
|
||||
async getPlayerInfo() {
|
||||
// 获取 米游社 API
|
||||
const { api, uid } = await this.getAPI();
|
||||
const { api, uid, deviceFp } = await this.getAPI();
|
||||
if (!api) return false;
|
||||
// 获取用户信息
|
||||
let userData = await api.getFinalData(this.e, 'zzzUser');
|
||||
let userData = await api.getFinalData(this.e, 'zzzUser', {
|
||||
deviceFp,
|
||||
});
|
||||
if (!userData) return false;
|
||||
// 取第一个用户信息
|
||||
userData =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue