🚨 typo

This commit is contained in:
目棃
2025-03-01 12:37:18 +08:00
parent cad8de6cd7
commit 7d0e0f187c
3 changed files with 7 additions and 8 deletions

View File

@@ -404,7 +404,6 @@ async function tryGetCaptcha(phone: string, aigis?: string): Promise<string | fa
showSnackbar.error(`[${captchaResp.retcode}] ${captchaResp.message}`);
return false;
}
// @ts-expect-error type {} is not assignable to type string
const aigisResp: TGApp.Plugins.Mys.CaptchaLogin.CaptchaAigis = JSON.parse(captchaResp.data);
const resp = await showGeetest(JSON.parse(aigisResp.data));
const aigisStr = `${aigisResp.session_id};${btoa(JSON.stringify(resp))}`;

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Mys/request/doCaptchaLogin.ts
* @description 通过短信验证码登录账号获取 stoken
* @since Beta v0.5.1
* @since Beta v0.7.1
*/
import showSnackbar from "@comp/func/snackbar.js";
@@ -36,7 +36,7 @@ function rsaEncrypt(data: string): string {
/**
* @description 获取短信验证码
* @since Beta v0.5.1
* @since Beta v0.7.1
* @param {string} phone - 手机号
* @param {string} [aigis] - 验证数据
* @returns {Promise<TGApp.Plugins.Mys.CaptchaLogin.CaptchaData | TGApp.BBS.Response.Base>}
@@ -44,7 +44,7 @@ function rsaEncrypt(data: string): string {
export async function getCaptcha(
phone: string,
aigis?: string,
): Promise<TGApp.Plugins.Mys.CaptchaLogin.CaptchaData | TGApp.BBS.Response.BaseWithData> {
): Promise<TGApp.Plugins.Mys.CaptchaLogin.CaptchaData | TGApp.BBS.Response.BaseWithData<string>> {
const url = "https://passport-api.mihoyo.com/account/ma-cn-verifier/verifier/createLoginCaptcha";
const device_fp = getDeviceInfo("device_fp");
const device_name = getDeviceInfo("device_name");
@@ -78,7 +78,7 @@ export async function getCaptcha(
);
const data = await resp.data;
if (data.retcode !== 0) {
return <TGApp.BBS.Response.BaseWithData>{
return <TGApp.BBS.Response.BaseWithData<string>>{
retcode: data.retcode,
message: data.message,
data: resp.resp.headers.get("x-rpc-aigis"),

View File

@@ -1,7 +1,7 @@
/**
* @file types/BBS/Response.d.ts
* @description BBS 返回数据类型定义文件
* @since Beta v0.6.0
* @since Beta v0.7.1
*/
declare namespace TGApp.BBS.Response {
@@ -19,11 +19,11 @@ declare namespace TGApp.BBS.Response {
/**
* @description 基础返回类型-带有 data 的
* @interface BaseWithData
* @since Beta v0.3.6
* @since Beta v0.7.1
* @property {0} retcode - 响应代码
* @property {string} message - 响应消息
* @property {any} data - 响应数据
* @return BaseWithData
*/
type BaseWithData = { retcode: 0; message: string; data: unknown };
type BaseWithData<T = unknown> = { retcode: 0; message: string; data: T };
}