support sms login
This commit is contained in:
@@ -6,7 +6,7 @@ const BASE_URI = "/notify/internal";
|
|||||||
export const NotifyAPI = {
|
export const NotifyAPI = {
|
||||||
|
|
||||||
async smsSend(captchaData: CaptchaData<Notify>) {
|
async smsSend(captchaData: CaptchaData<Notify>) {
|
||||||
return await axios.post("/sms/captcha/create", captchaData);
|
return await axios.post("/notify/sms/captcha/create", captchaData);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** 查询当前用户的站内通知详情。 */
|
/** 查询当前用户的站内通知详情。 */
|
||||||
|
|||||||
+10
-1
@@ -1,4 +1,4 @@
|
|||||||
import type {Attachment, CaptchaData, Gender, LoginRequest, LoginResponse, RegisterRequest, UpdatePasswordRequest, User, UserAttachType} from "../types";
|
import type {Attachment, CaptchaData, Gender, LoginRequest, LoginResponse, RegisterRequest, SmsLoginRequest, UpdatePasswordRequest, User, UserAttachType} from "../types";
|
||||||
import {axios} from "./BaseAPI";
|
import {axios} from "./BaseAPI";
|
||||||
import CommonAPI from "./CommonAPI";
|
import CommonAPI from "./CommonAPI";
|
||||||
|
|
||||||
@@ -33,6 +33,15 @@ export const UserAPI = {
|
|||||||
async login(req: CaptchaData<LoginRequest>): Promise<LoginResponse> {
|
async login(req: CaptchaData<LoginRequest>): Promise<LoginResponse> {
|
||||||
return await axios.post(`${BASE_URI}/login`, req);
|
return await axios.post(`${BASE_URI}/login`, req);
|
||||||
},
|
},
|
||||||
|
/**
|
||||||
|
* 短信验证码登录
|
||||||
|
*
|
||||||
|
* @param req 短信验证码登录请求
|
||||||
|
* @returns LoginResponse
|
||||||
|
*/
|
||||||
|
async loginBySms(req: SmsLoginRequest): Promise<LoginResponse> {
|
||||||
|
return await axios.post(`${BASE_URI}/login/sms`, req);
|
||||||
|
},
|
||||||
/**
|
/**
|
||||||
* 验证是否已登录
|
* 验证是否已登录
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -50,6 +50,11 @@ export type LoginRequest = {
|
|||||||
password: string;
|
password: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type SmsLoginRequest = {
|
||||||
|
detailId: string;
|
||||||
|
captcha: string;
|
||||||
|
};
|
||||||
|
|
||||||
export type UpdatePasswordRequest = {
|
export type UpdatePasswordRequest = {
|
||||||
oldValue: string;
|
oldValue: string;
|
||||||
newValue: string;
|
newValue: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user