19 lines
508 B
TypeScript
19 lines
508 B
TypeScript
import http from "@/api/http";
|
|
import type { UserProfile } from "@/types";
|
|
|
|
export interface UpdatePasswordPayload {
|
|
oldPassword: string;
|
|
newPassword: string;
|
|
confirmPassword?: string;
|
|
}
|
|
|
|
export async function getCurrentUser() {
|
|
const resp = await http.get("/sys/api/users/me");
|
|
return resp.data.data as UserProfile;
|
|
}
|
|
|
|
export async function updateMyPassword(payload: UpdatePasswordPayload) {
|
|
const resp = await http.put("/sys/api/users/password", payload);
|
|
return resp.data.data as boolean;
|
|
}
|