Skip to content

fix(deploy): auto-initialize admin before login in sync hooks#236

Merged
Thomas-Eliot merged 1 commit intohigress-group:mainfrom
lexburner:fix/deploy-admin-auto-init
Apr 1, 2026
Merged

fix(deploy): auto-initialize admin before login in sync hooks#236
Thomas-Eliot merged 1 commit intohigress-group:mainfrom
lexburner:fix/deploy-admin-auto-init

Conversation

@lexburner
Copy link
Copy Markdown
Contributor

📝 Description

在 Nacos 同步钩子(65-sync-nacos-market.sh)中增加管理员自动初始化步骤,解决全新安装或重装后 administrator 表为空导致后续登录失败、整个同步流程中断的问题。

  • 新增 ensure_admin_initialized 函数,在登录前幂等地调用 /api/v1/admins/need-init 检查状态,必要时调用 /api/v1/admins/init 创建管理员
  • Docker Compose 和 Helm 两套部署钩子同步更新
  • 调整 main 函数中步骤编号保持一致

🔗 Related Issues

✅ Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Code refactoring (no functional changes)
  • Performance improvement
  • Build/CI configuration change
  • Other (please describe):

🧪 Testing

  • Manual testing completed
  • All tests pass locally

📋 Checklist

  • Code has been formatted (mvn spotless:apply for backend, npm run lint:fix for frontend)
  • Code is self-reviewed
  • Comments added for complex code
  • No breaking changes (or migration guide provided)

在 Nacos 同步钩子中增加管理员自动初始化步骤(ensure_admin_initialized),
解决全新安装或重装后 administrator 表为空导致登录失败的问题。

- 新增 ensure_admin_initialized 函数,在登录前幂等地检查并创建管理员
- Docker 和 Helm 两套部署脚本同步更新
- 调整 main 中步骤编号保持一致

🤖 Generated with [Qoder][https://qoder.com]
Copy link
Copy Markdown
Collaborator

@Thomas-Eliot Thomas-Eliot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Thomas-Eliot Thomas-Eliot merged commit 574d71b into higress-group:main Apr 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants