feat: 新增找回密码功能

This commit is contained in:
橙子
2024-10-04 00:00:44 +08:00
parent d7629763ef
commit 10e1fad7f3
21 changed files with 602 additions and 297 deletions

View File

@@ -7,7 +7,7 @@ import {
userLogin,
getUserDetailInfo,
userLogout,
userRegister,
userRegister, userRetrievePassword,
} from "@/apis/auth";
const TokenKey = "AccessToken";
export const AUTH_MENUS = "AUTH_MENUS";
@@ -182,6 +182,20 @@ const currentUserInfo=computed(()=>{
// }
};
// 找回密码
const retrievePasswordFun = async (params) => {
// try {
const {data}=await userRetrievePassword(params);
ElMessage({
message: `恭喜!账号:${data},找回成功!密码已重置,请登录!`,
type: "success",
duration: 8000
});
// } catch (error) {
// console.log(error);
// }
};
return {
getToken,
setToken,
@@ -189,6 +203,7 @@ const currentUserInfo=computed(()=>{
loginFun,
getUserInfo,
logoutFun,
retrievePasswordFun,
clearStorage,
registerFun,
loginSuccess,