mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-05 05:50:19 +08:00
feat: set password for users
Signed-off-by: Kininaru <shiftregister233@outlook.com> removed useless blank Signed-off-by: Kininaru <shiftregister233@outlook.com> add license header Signed-off-by: Kininaru <shiftregister233@outlook.com> i18n Signed-off-by: Kininaru <shiftregister233@outlook.com> database logic Signed-off-by: Kininaru <shiftregister233@outlook.com> i18n Signed-off-by: Kininaru <shiftregister233@outlook.com> i18n Signed-off-by: Kininaru <shiftregister233@outlook.com>
This commit is contained in:
@ -79,3 +79,16 @@ export function uploadAvatar(avatar) {
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
export function setPassword(userOwner, userName, oldPassword, newPassword) {
|
||||
let formData = new FormData();
|
||||
formData.append("userOwner", userOwner);
|
||||
formData.append("userName", userName);
|
||||
formData.append("oldPassword", oldPassword);
|
||||
formData.append("newPassword", newPassword);
|
||||
return fetch(`${Setting.ServerUrl}/api/set-password`, {
|
||||
method: "POST",
|
||||
credentials: "include",
|
||||
body: formData
|
||||
}).then(res => res.json());
|
||||
}
|
||||
|
Reference in New Issue
Block a user