feat(client): 首次登录改密守卫与错误文案(F35,F38)
- 登录响应支持 mustChangePassword 并强制跳转改密页 - 新增改密页面与全局路由守卫 - 完善 AUTH_002/SYS_429/VALID_00x 等错误提示
这个提交包含在:
@@ -0,0 +1,19 @@
|
||||
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),
|
||||
});
|
||||
}
|
||||
|
||||
在新工单中引用
屏蔽一个用户