Function
changePassword
(
email: string,
oldPassword: string,
newPassword: string,
)
Source from the content-addressed store, hash-verified
| 97 | * 修改密码(登录态下) |
| 98 | */ |
| 99 | export async function changePassword( |
| 100 | email: string, |
| 101 | oldPassword: string, |
| 102 | newPassword: string, |
| 103 | ): Promise<boolean> { |
| 104 | const oldHash = await sha256(oldPassword); |
| 105 | const newHash = await sha256(newPassword); |
| 106 | const url = `/setup/?email=${encodeURIComponent(email)}&crypt=${newHash}&pass=${oldHash}`; |
| 107 | const res = await http.get<ApiResp>(url); |
| 108 | return res.status === 200; |
| 109 | } |
| 110 | |
| 111 | /** |
| 112 | * 检查登录状态 |
Callers
nothing calls this directly
Tested by
no test coverage detected