feat: update

This commit is contained in:
landaiqing
2024-05-29 21:33:58 +08:00
parent cb9c827220
commit 4ce065214a
11 changed files with 173 additions and 144 deletions

View File

@@ -1,5 +1,7 @@
import type { TicketInfoType, TokenInfoType } from "react-rotate-captcha";
import { getCaptcha, VerfiyCaptcha } from "@/api/captcha/api.ts";
/** @format */
import type { TokenInfoType } from "react-rotate-captcha";
import { getCaptcha } from "@/api/captcha/api.ts";
export type ActionType = {
code: 0 | 1;
@@ -36,11 +38,10 @@ export function sleep(time: number) {
});
}
export async function verify(token: string, deg: number): Promise<TicketInfoType> {
const data: any = {
token: token,
deg: deg,
};
const res: any = await VerfiyCaptcha(data);
return res;
}
// export async function verify(token: string, deg: number): Promise<TicketInfoType> {
// const data: any = {
// token: token,
// deg: deg,
// };
// return await VerfiyCaptcha(data);
// }

View File

@@ -21,3 +21,26 @@ export const oauthLogin = (type: string) => {
method: "get",
});
};
/**
* 获取短信验证码
* @param phone
*/
export const getSms = (phone: string) => {
return web.request({
url: "/sms/sendByTemplate/" + phone,
method: "post",
});
};
/**
* 注册
* @param data
*/
export const register = (data: API.PhoneRegisterRequest) => {
return web.request({
url: "/auth/user/register",
method: "post",
data: data,
});
};