feat:拦截国际服

This commit is contained in:
kissnavel 2025-01-11 22:18:21 +08:00
parent 7ffe3e6451
commit 1dd7fe9fb5
2 changed files with 9 additions and 9 deletions

View file

@ -157,9 +157,7 @@ export class GachaLog extends ZZZPlugin {
} }
async getLog(key) { async getLog(key) {
const uid = await this.getUID(); const uid = await this.getUID();
if (!uid) { if (!uid) return false;
return false;
}
this.reply('抽卡记录获取中请稍等...可能需要一段时间,请耐心等待'); this.reply('抽卡记录获取中请稍等...可能需要一段时间,请耐心等待');
const { data, count } = await updateGachaLog(key, uid); const { data, count } = await updateGachaLog(key, uid);
let msg = []; let msg = [];
@ -225,9 +223,7 @@ export class GachaLog extends ZZZPlugin {
await this.reply('抽卡记录相应功能只支持国服'); await this.reply('抽卡记录相应功能只支持国服');
return false; return false;
} }
if (!uid) { if (!uid) return false;
return false;
}
await this.getPlayerInfo(); await this.getPlayerInfo();
await this.reply('正在分析抽卡记录,请稍等', false, { await this.reply('正在分析抽卡记录,请稍等', false, {
at: true, at: true,
@ -256,13 +252,11 @@ export class GachaLog extends ZZZPlugin {
await this.reply('抽卡记录相应功能只支持国服'); await this.reply('抽卡记录相应功能只支持国服');
return false; return false;
} }
if (!uid) return false;
if (!this.e.isPrivate || this.e.isGroup) { if (!this.e.isPrivate || this.e.isGroup) {
await this.reply('请私聊获取抽卡链接', false, { at: true }); await this.reply('请私聊获取抽卡链接', false, { at: true });
return false; return false;
} }
if (!uid) {
return false;
}
const key = await getAuthKey(this.e, this.User, uid); const key = await getAuthKey(this.e, this.User, uid);
if (!key) { if (!key) {
await this.reply('authKey获取失败请检查cookie是否过期'); await this.reply('authKey获取失败请检查cookie是否过期');

View file

@ -29,6 +29,10 @@ export class Panel extends ZZZPlugin {
} }
async bindDevice() { async bindDevice() {
const uid = await this.getUID(); const uid = await this.getUID();
if (/^(1[0-9])[0-9]{8}/i.test(uid)) {
await this.reply('国际服不需要绑定设备');
return false;
}
//先throw一步 //先throw一步
this.setContext('toBindDevice'); this.setContext('toBindDevice');
await this.reply( await this.reply(
@ -97,6 +101,8 @@ export class Panel extends ZZZPlugin {
} }
} }
async deleteBind() { async deleteBind() {
const uid = await this.getUID();
if (/^(1[0-9])[0-9]{8}/i.test(uid)) return false;
const ltuid = await this.getLtuid(); const ltuid = await this.getLtuid();
await redis.del(`ZZZ:DEVICE_FP:${ltuid}:FP`); await redis.del(`ZZZ:DEVICE_FP:${ltuid}:FP`);
await redis.del(`ZZZ:DEVICE_FP:${ltuid}:BIND`); await redis.del(`ZZZ:DEVICE_FP:${ltuid}:BIND`);