update README & fix gacha

This commit is contained in:
bietiaop 2024-07-10 14:47:23 +08:00
parent f838c0823d
commit 105dc1846f
9 changed files with 328 additions and 15 deletions

View file

@ -15,6 +15,7 @@ export async function getAuthKey(e, zzzUid, authAppid = 'csc') {
if (!User) {
throw new Error('未安装逍遥插件,无法自动刷新抽卡链接');
}
logger.mark(zzzUid);
const user = new User(e);
await user.getCookie(e);
let ck = await user.getStoken(e.user_id);
@ -28,7 +29,9 @@ export async function getAuthKey(e, zzzUid, authAppid = 'csc') {
}
default:
}
logger.mark(type);
const { url, headers, body } = api.getUrl(type);
logger.mark(url);
let res = await fetch(url, {
method: 'POST',
headers,

View file

@ -18,7 +18,7 @@ export default class MysZZZApi extends MysApi {
constructor(uid, cookie, option = {}) {
super(uid, cookie, option, true);
this.uid = uid;
this.server = this.getServer();
this.server = this.getServer(uid);
this.apiTool = new ZZZApiTool(uid, this.server);
if (typeof this.cookie != 'string' && this.cookie) {
let ck =
@ -32,7 +32,7 @@ export default class MysZZZApi extends MysApi {
}
getServer() {
const _uid = this.uid.toString();
const _uid = this.uid?.toString();
if (_uid.length < 10) {
return game_region[0]; // 官服
}