mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-11-02 16:57:11 +08:00
新增:新增修改邮箱功能,并优化部分以往代码(引入 spring-boot-starter-mail 用于发送邮件验证码)
This commit is contained in:
@@ -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;
|
||||
|
||||
22
continew-admin-ui/src/api/common/captcha.ts
Normal file
22
continew-admin-ui/src/api/common/captcha.ts
Normal 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);
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user