mirror of
https://github.com/certd/certd.git
synced 2026-05-16 13:17:29 +08:00
perf: 新增找回密码功能 @nicheng-he
* feat 找回密码 * 1.发送邮件时修改模版 2.重置成功时清除登陆错误次数 * 增加自助找回密码控制 * 补充接口自助找回判断
This commit is contained in:
@@ -36,6 +36,7 @@ export type SysPublicSetting = {
|
||||
emailRegisterEnabled?: boolean;
|
||||
passwordLoginEnabled?: boolean;
|
||||
smsLoginEnabled?: boolean;
|
||||
selfServicePasswordRetrievalEnabled?: boolean;
|
||||
|
||||
limitUserPipelineCount?: number;
|
||||
managerOtherUserPipeline?: boolean;
|
||||
|
||||
@@ -20,6 +20,17 @@ export interface SmsLoginReq {
|
||||
randomStr: string;
|
||||
}
|
||||
|
||||
export interface ForgotPasswordReq {
|
||||
forgotPasswordType: string;
|
||||
input: string;
|
||||
randomStr: string;
|
||||
imgCode: string;
|
||||
validateCode: string;
|
||||
|
||||
password: string;
|
||||
confirmPassword: string;
|
||||
}
|
||||
|
||||
export interface UserInfoRes {
|
||||
id: string | number;
|
||||
username: string;
|
||||
@@ -43,6 +54,13 @@ export async function register(user: RegisterReq): Promise<UserInfoRes> {
|
||||
data: user,
|
||||
});
|
||||
}
|
||||
export async function forgotPassword(data: ForgotPasswordReq): Promise<any> {
|
||||
return await request({
|
||||
url: "/forgotPassword",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
export async function logout() {
|
||||
return await request({
|
||||
url: "/logout",
|
||||
|
||||
@@ -4,7 +4,7 @@ import router from "../../router";
|
||||
import { LocalStorage } from "/src/utils/util.storage";
|
||||
// @ts-ignore
|
||||
import * as UserApi from "./api.user";
|
||||
import { RegisterReq, SmsLoginReq } from "./api.user";
|
||||
import { ForgotPasswordReq, RegisterReq, SmsLoginReq } from "./api.user";
|
||||
// @ts-ignore
|
||||
import { LoginReq, UserInfoRes } from "/@/store/user/api.user";
|
||||
import { message, Modal, notification } from "ant-design-vue";
|
||||
@@ -67,6 +67,13 @@ export const useUserStore = defineStore({
|
||||
});
|
||||
await router.replace("/login");
|
||||
},
|
||||
async forgotPassword(params: ForgotPasswordReq): Promise<any> {
|
||||
await UserApi.forgotPassword(params);
|
||||
notification.success({
|
||||
message: "密码已重置,请登录",
|
||||
});
|
||||
await router.replace("/login");
|
||||
},
|
||||
/**
|
||||
* @description: login
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user