mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-17 13:47:44 +00:00
fix: ck提示;抽卡记录
This commit is contained in:
parent
d6ab61fe5a
commit
4ed3555f33
4 changed files with 30 additions and 19 deletions
|
|
@ -44,6 +44,10 @@ export class Panel extends ZZZPlugin {
|
||||||
await this.reply('正在刷新面板列表,请稍候...');
|
await this.reply('正在刷新面板列表,请稍候...');
|
||||||
await this.getPlayerInfo();
|
await this.getPlayerInfo();
|
||||||
const result = await refreshPanel(this.e, api, uid, deviceFp);
|
const result = await refreshPanel(this.e, api, uid, deviceFp);
|
||||||
|
if (!result) {
|
||||||
|
await this.reply('面板列表刷新失败,请稍后再试');
|
||||||
|
return;
|
||||||
|
}
|
||||||
const newChar = result.filter(item => item.isNew);
|
const newChar = result.filter(item => item.isNew);
|
||||||
let str = '面板列表获取成功,本次共刷新了' + newChar.length + '个角色:\n';
|
let str = '面板列表获取成功,本次共刷新了' + newChar.length + '个角色:\n';
|
||||||
for (const item of result) {
|
for (const item of result) {
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,9 @@ export default class MysZZZApi extends MysApi {
|
||||||
const ck = Object.values(this.cookie).find(item => {
|
const ck = Object.values(this.cookie).find(item => {
|
||||||
return item.ck && item.uid === uid;
|
return item.ck && item.uid === uid;
|
||||||
});
|
});
|
||||||
logger.debug(ck);
|
if (!ck) {
|
||||||
|
throw new Error(`[ZZZ]要查询的UID:${uid}未绑定Cookie`);
|
||||||
|
}
|
||||||
this._device = ck?.device_id || ck?.device;
|
this._device = ck?.device_id || ck?.device;
|
||||||
this.cookie = ck?.ck;
|
this.cookie = ck?.ck;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ export class ZZZPlugin extends plugin {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
// 创建米游社 API 对象
|
// 创建米游社 API 对象
|
||||||
const api = new MysZZZApi(uid, ck);
|
const api = new MysZZZApi(uid, ck);
|
||||||
// 获取设备指纹
|
// 获取设备指纹
|
||||||
|
|
@ -71,6 +72,9 @@ export class ZZZPlugin extends plugin {
|
||||||
}
|
}
|
||||||
// 返回数据(API、UID、设备指纹)
|
// 返回数据(API、UID、设备指纹)
|
||||||
return { api, uid, deviceFp };
|
return { api, uid, deviceFp };
|
||||||
|
} catch (error) {
|
||||||
|
this.reply(error.message);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import _ from 'lodash';
|
||||||
/**
|
/**
|
||||||
* 生成随机字符串
|
* 生成随机字符串
|
||||||
* @param {number} length 长度
|
* @param {number} length 长度
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue