mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 21:27:47 +00:00
refactor: 重构lib代码(无实质性功能更新,可不更新)
This commit is contained in:
parent
a7f06d404b
commit
aa3b7928ec
26 changed files with 547 additions and 483 deletions
|
|
@ -75,7 +75,9 @@ export class ZZZPlugin extends plugin {
|
|||
}
|
||||
|
||||
// 创建米游社 API 对象
|
||||
const api = new MysZZZApi(uid, ck);
|
||||
const api = new MysZZZApi(uid, ck, {
|
||||
handler: this.e?.runtime?.handler || {},
|
||||
});
|
||||
const currentCK = Object.values(ck).find(item => {
|
||||
return item.ck && item.uid === uid;
|
||||
});
|
||||
|
|
@ -175,7 +177,11 @@ export class ZZZPlugin extends plugin {
|
|||
// 获取 米游社 API
|
||||
const { api, uid } = await this.getAPI();
|
||||
// 获取用户信息
|
||||
let userData = await api.getFinalData(this.e, 'zzzUser');
|
||||
let userData = await api.getFinalData('zzzUser').catch(e => {
|
||||
this.reply(e.message);
|
||||
throw e;
|
||||
});
|
||||
|
||||
if (!userData) throw new Error('获取用户数据失败');
|
||||
// 取第一个用户信息
|
||||
userData =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue