feat: 标准化凭据获取

This commit is contained in:
手瓜一十雪
2024-10-22 11:04:28 +08:00
parent 1d5483dc28
commit e6b6947d49
5 changed files with 48 additions and 3 deletions

View File

@@ -5,8 +5,12 @@ 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: '',
token: +this.core.apis.WebApi.getBknFromSKey(sKey),
};
}
}