Enable fallback_admin by default with Admin@123.

Initial deploys often cannot scan UAC QR; seed the emergency account unless roles.json explicitly disabled it.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
oliver 2026-09-08 11:09:14 +08:00
parent 6455feed65
commit 337f6501b0
4 changed files with 8 additions and 5 deletions

View file

@ -266,7 +266,7 @@ export class RolesStore {
// === Fallback Administrator ===
setFallbackPassword(password, currentAdminRole) {
if (currentAdminRole !== ROLES.SUPER_ADMIN) {
if (currentAdminRole !== ROLES.SUPER_ADMIN && currentAdminRole !== ROLES.FALLBACK_ADMIN) {
throw new Error('只有超级管理员可以设置兜底管理员密码')
}
if (!password || password.length < 6) {
@ -278,7 +278,7 @@ export class RolesStore {
}
clearFallbackPassword(currentAdminRole) {
if (currentAdminRole !== ROLES.SUPER_ADMIN) {
if (currentAdminRole !== ROLES.SUPER_ADMIN && currentAdminRole !== ROLES.FALLBACK_ADMIN) {
throw new Error('只有超级管理员可以清除兜底管理员密码')
}
this._fallbackPasswordHash = null