mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 21:30:24 +08:00
feat: optimize the "forget password" page (#1709)
This commit is contained in:
@ -93,12 +93,16 @@ export function getAffiliationOptions(url, code) {
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
||||
export function setPassword(userOwner, userName, oldPassword, newPassword) {
|
||||
export function setPassword(userOwner, userName, oldPassword, newPassword, code = "") {
|
||||
const formData = new FormData();
|
||||
formData.append("userOwner", userOwner);
|
||||
formData.append("userName", userName);
|
||||
formData.append("oldPassword", oldPassword);
|
||||
formData.append("newPassword", newPassword);
|
||||
if (code) {
|
||||
formData.append("code", code);
|
||||
}
|
||||
|
||||
return fetch(`${Setting.ServerUrl}/api/set-password`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
@ -188,3 +192,14 @@ export function getCaptcha(owner, name, isCurrentProvider) {
|
||||
},
|
||||
}).then(res => res.json()).then(res => res.data);
|
||||
}
|
||||
|
||||
export function verifyCode(values) {
|
||||
return fetch(`${Setting.ServerUrl}/api/verify-code`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: JSON.stringify(values),
|
||||
headers: {
|
||||
"Accept-Language": Setting.getAcceptLanguage(),
|
||||
},
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
Reference in New Issue
Block a user