文件
hyb-oa/client/src/api/auth.ts
T
wangsli 2566289d37 feat(client): 首次登录改密守卫与错误文案(F35,F38)
- 登录响应支持 mustChangePassword 并强制跳转改密页
- 新增改密页面与全局路由守卫
- 完善 AUTH_002/SYS_429/VALID_00x 等错误提示
2026-02-09 18:16:22 +08:00

20 行
546 B
TypeScript

import { apiRequestData } from "./http";
import { getDeviceFingerprint } from "../auth/deviceFingerprint";
import type { LoginResponse } from "./types";
const JSON_HEADERS = {
"content-type": "application/json",
};
export async function changePassword(payload: { oldPassword: string; newPassword: string }) {
return apiRequestData<LoginResponse>("/api/auth/change-password", {
method: "POST",
headers: {
...JSON_HEADERS,
"x-device-fingerprint": getDeviceFingerprint(),
},
body: JSON.stringify(payload),
});
}