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
|
|
@ -110,6 +110,16 @@ export default class MysZZZApi extends MysApi {
|
|||
if (this._device) {
|
||||
headers['x-rpc-device_id'] = this._device;
|
||||
}
|
||||
if (data?.deviceInfo && data?.modelName) {
|
||||
const deviceBrand = data.deviceInfo?.split('/')[0];
|
||||
try {
|
||||
headers['x-rpc-device_name'] = `${deviceBrand} ${data.modelName}`;
|
||||
headers['x-rpc-device_model'] = data.modelName;
|
||||
headers['x-rpc-csm_source'] = 'myself';
|
||||
} catch (error) {
|
||||
logger.error(`[ZZZ]设备信息解析失败:${error.message}`);
|
||||
}
|
||||
}
|
||||
// 写入DS
|
||||
switch (dsSalt) {
|
||||
case 'web': {
|
||||
|
|
@ -136,7 +146,6 @@ export default class MysZZZApi extends MysApi {
|
|||
body = JSON.stringify(body);
|
||||
}
|
||||
}
|
||||
logger.debug(`[mysapi]请求url:${url}`);
|
||||
// 返回请求参数
|
||||
return { url, headers, body };
|
||||
}
|
||||
|
|
@ -237,20 +246,16 @@ export default class MysZZZApi extends MysApi {
|
|||
break;
|
||||
case 10102:
|
||||
if (res.message === 'Data is not public for the user') {
|
||||
this.e.reply(
|
||||
`\nUID:${this.uid},米游社数据未公开`, false, { at: this.userId }
|
||||
);
|
||||
this.e.reply(`\nUID:${this.uid},米游社数据未公开`, false, {
|
||||
at: this.userId,
|
||||
});
|
||||
} else {
|
||||
this.e.reply(
|
||||
`UID:${this.uid},请先去米游社绑定角色`
|
||||
);
|
||||
this.e.reply(`UID:${this.uid},请先去米游社绑定角色`);
|
||||
}
|
||||
break;
|
||||
case 10041:
|
||||
case 5003:
|
||||
this.e.reply(
|
||||
`UID:${this.uid},米游社账号异常,暂时无法查询`
|
||||
);
|
||||
this.e.reply(`UID:${this.uid},米游社账号异常,暂时无法查询`);
|
||||
break;
|
||||
case 10035:
|
||||
case 1034: {
|
||||
|
|
@ -274,20 +279,14 @@ export default class MysZZZApi extends MysApi {
|
|||
logger.mark(
|
||||
`[米游社zzz查询失败][UID:${this.uid}][qq:${this.userId}] 遇到验证码`
|
||||
);
|
||||
this.e.reply(
|
||||
'米游社zzz查询遇到验证码,请稍后再试'
|
||||
);
|
||||
this.e.reply('米游社zzz查询遇到验证码,请稍后再试');
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
if (/(登录|login)/i.test(res.message)) {
|
||||
logger.mark(
|
||||
`[ck失效][UID:${this.uid}]`
|
||||
);
|
||||
this.e.reply(
|
||||
`UID:${this.uid},米游社cookie已失效`
|
||||
);
|
||||
logger.mark(`[ck失效][UID:${this.uid}]`);
|
||||
this.e.reply(`UID:${this.uid},米游社cookie已失效`);
|
||||
} else {
|
||||
this.e.reply(
|
||||
`米游社接口报错,暂时无法查询:${res.message || 'error'}`
|
||||
|
|
@ -311,6 +310,28 @@ export default class MysZZZApi extends MysApi {
|
|||
* @param {boolean} cached
|
||||
*/
|
||||
async getFinalData(e, type, data = {}, cached = false) {
|
||||
if (data.deviceFp) {
|
||||
if (!data.headers) data.headers = {};
|
||||
data.headers['x-rpc-device_fp'] = data.deviceFp;
|
||||
}
|
||||
const uid = this.uid;
|
||||
let bindInfo = await redis.get(`ZZZ:DEVICE_FP:${uid}:BIND`);
|
||||
if (bindInfo) {
|
||||
try {
|
||||
bindInfo = JSON.parse(bindInfo);
|
||||
data = {
|
||||
...data,
|
||||
productName: bindInfo?.deviceProduct,
|
||||
deviceType: bindInfo?.deviceName,
|
||||
modelName: bindInfo?.deviceModel,
|
||||
oaid: bindInfo?.oaid,
|
||||
deviceInfo: bindInfo?.deviceFingerprint,
|
||||
board: bindInfo?.deviceBoard,
|
||||
};
|
||||
} catch (error) {
|
||||
bindInfo = null;
|
||||
}
|
||||
}
|
||||
const result = await this.getData(type, data, cached);
|
||||
const _data = await this.checkCode(e, result, type, {});
|
||||
if (!_data || _data.retcode !== 0) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue