style: RegExec match->exec

This commit is contained in:
手瓜一十雪 committed 2024-08-26 00:45:12 +08:00
1 parent 5486ffcdcc
commit 5f1d8fb99d
5 files changed
+10 -7

No files matched your search

+1 -1
View File
@@ -129,7 +129,7 @@ export class NTQQUserApi {
}
async getUserDetailInfo(uid: string): Promise<User> {
const retUser = await solveAsyncProblem(async (uid) => this.fetchUserDetailInfo(uid, UserDetailSource.KDB));
const retUser = await solveAsyncProblem(async (uid) => this.fetchUserDetailInfo(uid, UserDetailSource.KDB), uid);
if (retUser && retUser.uin !== '0') {
return retUser;
}
+1 -1
View File
@@ -166,7 +166,7 @@ export class NTQQWebApi {
let resJson;
try {
const res = await RequestUtil.HttpGetText(url, 'GET', '', { 'Cookie': this.cookieToString(cookieObject) });
const match = res.match(/window\.__INITIAL_STATE__=(.*?);/);
let match = /window\.__INITIAL_STATE__=(.*?);/.exec(res);
if (match) {
resJson = JSON.parse(match[1].trim());
}