新增:新增修改邮箱功能,并优化部分以往代码(引入 spring-boot-starter-mail 用于发送邮件验证码)

This commit is contained in:
2023-01-14 01:05:39 +08:00
parent 73fadb8315
commit 8b82557883
45 changed files with 1318 additions and 280 deletions

View File

@@ -2,14 +2,6 @@ import axios from 'axios';
import type { RouteRecordNormalized } from 'vue-router';
import { UserState } from '@/store/modules/login/types';
export interface ImageCaptchaRes {
uuid: string;
img: string;
}
export function getImageCaptcha() {
return axios.get<ImageCaptchaRes>('/captcha/img');
}
export interface LoginReq {
username: string;
password: string;

View File

@@ -0,0 +1,22 @@
import axios from 'axios';
import qs from 'query-string';
export interface ImageCaptchaRes {
uuid: string;
img: string;
}
export function getImageCaptcha() {
return axios.get<ImageCaptchaRes>('/common/captcha/img');
}
export interface MailCaptchaReq {
email: string;
}
export function getMailCaptcha(params: MailCaptchaReq) {
return axios.get('/common/captcha/mail', {
params,
paramsSerializer: (obj) => {
return qs.stringify(obj);
},
});
}

View File

@@ -27,4 +27,13 @@ export interface UpdatePasswordReq {
}
export function updatePassword(req: UpdatePasswordReq) {
return axios.patch('/system/user/center/password', req);
}
export interface UpdateEmailReq {
newEmail: string;
captcha: string;
currentPassword: string;
}
export function updateEmail(req: UpdateEmailReq) {
return axios.patch('/system/user/center/email', req);
}