mirror of
https://github.com/certd/certd.git
synced 2026-04-23 11:37:23 +08:00
perf: 支持短信验证码登录
This commit is contained in:
@@ -25,6 +25,12 @@ export type PlusInfo = {
|
||||
};
|
||||
export type SysPublicSetting = {
|
||||
registerEnabled?: boolean;
|
||||
usernameRegisterEnabled?: boolean;
|
||||
mobileRegisterEnabled?: boolean;
|
||||
emailRegisterEnabled?: boolean;
|
||||
passwordLoginEnabled?: boolean;
|
||||
smsLoginEnabled?: boolean;
|
||||
|
||||
limitUserPipelineCount?: number;
|
||||
managerOtherUserPipeline?: boolean;
|
||||
icpNo?: string;
|
||||
@@ -35,6 +41,10 @@ export type SysPrivateSetting = {
|
||||
httpsProxy?: string;
|
||||
dnsResultOrder?: string;
|
||||
commonCnameEnabled?: boolean;
|
||||
sms?: {
|
||||
type?: string;
|
||||
config?: any;
|
||||
};
|
||||
};
|
||||
export type SysInstallInfo = {
|
||||
siteId: string;
|
||||
@@ -73,3 +83,19 @@ export async function bindUrl(data: any): Promise<any> {
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export async function sendSmsCode(data: any): Promise<any> {
|
||||
return await request({
|
||||
url: "/basic/code/sendSmsCode",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export async function sendEmailCode(data: any): Promise<any> {
|
||||
return await request({
|
||||
url: "/basic/code/sendEmailCode",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,6 +14,13 @@ export interface LoginReq {
|
||||
password: string;
|
||||
}
|
||||
|
||||
export interface SmsLoginReq {
|
||||
mobile: string;
|
||||
phoneCode: string;
|
||||
smsCode: string;
|
||||
randomStr: string;
|
||||
}
|
||||
|
||||
export interface UserInfoRes {
|
||||
id: string | number;
|
||||
username: string;
|
||||
@@ -52,6 +59,15 @@ export async function login(data: LoginReq): Promise<LoginRes> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function loginBySms(data: SmsLoginReq): Promise<LoginRes> {
|
||||
//如果开启了登录与权限模块,则真实登录
|
||||
return await request({
|
||||
url: "/loginBySms",
|
||||
method: "post",
|
||||
data
|
||||
});
|
||||
}
|
||||
|
||||
export async function mine(): Promise<UserInfoRes> {
|
||||
if (env.PM_ENABLED === "false") {
|
||||
//没有开启权限模块,模拟登录
|
||||
|
||||
Reference in New Issue
Block a user