新增管理员密码重置
This commit is contained in:
@@ -91,6 +91,10 @@ async function EnableAgent() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户的代理信息
|
||||
* @returns
|
||||
*/
|
||||
async function GetUserAgentInfo(): Promise<UserModel.UserAgentInfo> {
|
||||
let res = await request<ApiResponse.SuccessItem<UserModel.UserAgentInfo>>(`/lms/User/GetUserAgentInfo`, {
|
||||
method: 'GET',
|
||||
@@ -101,10 +105,28 @@ async function GetUserAgentInfo(): Promise<UserModel.UserAgentInfo> {
|
||||
return res.data;
|
||||
}
|
||||
|
||||
export {
|
||||
/**
|
||||
* 重置指定用户的用户名和密码
|
||||
* @param userId
|
||||
* @param newPassword
|
||||
*/
|
||||
async function ResetUserPassword(userId: number, newPassword: string): Promise<void> {
|
||||
let res = await request<ApiResponse.SuccessItem<null>>(`/lms/User/ResetPassword/${userId}`, {
|
||||
method: 'post',
|
||||
data: {
|
||||
newPassword: newPassword,
|
||||
}
|
||||
});
|
||||
if (res.code != 1) {
|
||||
throw new Error(res.message);
|
||||
}
|
||||
}
|
||||
|
||||
export const UserInfo = {
|
||||
QueryUserList,
|
||||
GetUserInfo,
|
||||
UpdatedUserInfo,
|
||||
EnableAgent,
|
||||
GetUserAgentInfo,
|
||||
ResetUserPassword,
|
||||
}
|
||||
Reference in New Issue
Block a user