mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
17 lines
446 B
TypeScript
17 lines
446 B
TypeScript
import BaseAction from '../BaseAction';
|
|
import { ActionName } from '../types';
|
|
|
|
export class GetCSRF extends BaseAction<any, any> {
|
|
actionName = ActionName.GetCSRF;
|
|
|
|
async _handle(payload: any) {
|
|
const sKey = await this.core.apis.UserApi.getSKey();
|
|
if (!sKey) {
|
|
throw new Error('SKey is undefined');
|
|
}
|
|
return {
|
|
token: +this.core.apis.WebApi.getBknFromSKey(sKey),
|
|
};
|
|
}
|
|
}
|