新增首次登录初始化密码接口 init-passwd(无需原密码)
1. 后端新增 POST /api/auth/init-passwd:仅 need_change_password=1 时可用,校验密码策略后直接设置新密码并清除旧 Token 2. 管理端所有页面增加首次登录设置密码弹窗(无需原密码),成功后强制重新登录 3. 学生端首次登录改密改用 init-passwd;管理员重置密码后也要求下次登录重新设置 4. 日常修改密码仍走 change-password(需原密码)
This commit is contained in:
1 parent
2d3513b246
commit
db278188c6
7 files changed
+114
-6
No files matched your search
@@ -485,10 +485,8 @@ include __DIR__ . '/../includes/header.php';
|
||||
return;
|
||||
}
|
||||
|
||||
const res = await apiPost('/api/auth/change-password', {
|
||||
old_password: '',
|
||||
new_password: newPassword,
|
||||
force: true
|
||||
const res = await apiPost('/api/auth/init-passwd', {
|
||||
new_password: newPassword
|
||||
});
|
||||
|
||||
if (res && res.success) {
|
||||
|
||||
Reference in new issue
Block a user