mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 05:50:19 +08:00
feat: add reset email by verification code
Signed-off-by: Kininaru <shiftregister233@outlook.com>
This commit is contained in:
@ -92,3 +92,26 @@ export function setPassword(userOwner, userName, oldPassword, newPassword) {
|
||||
body: formData
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function sendCode(dest, type) {
|
||||
let formData = new FormData();
|
||||
formData.append("dest", dest);
|
||||
formData.append("type", type);
|
||||
return fetch(`${Setting.ServerUrl}/api/send-verification-code`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: formData
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function resetEmailOrPhone(dest, type, code) {
|
||||
let formData = new FormData();
|
||||
formData.append("dest", dest);
|
||||
formData.append("type", type);
|
||||
formData.append("code", code);
|
||||
return fetch(`${Setting.ServerUrl}/api/reset-email-or-phone`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: formData
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
Reference in New Issue
Block a user