feat: 交付官方 Docker 运行时,外观改背景图并下线自定义 CSS/JS

站点/后台分轨背景与用户列表排序一并落地;生产 CORS 改走 SITE_URL,健康检查带版本号。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-09-18 05:27:33 +08:00
parent 5f7193042f
commit d784b0ea7a
68 changed files with 2588 additions and 768 deletions

View File

@@ -98,12 +98,21 @@ func (s *AuthService) Register(username, email, password string) (*model.User, e
return nil, err
}
var n int64
if err := s.db.Model(&model.User{}).Count(&n).Error; err != nil {
return nil, err
}
role := model.RoleUser
if n == 0 {
role = model.RoleOwner
}
user := &model.User{
Username: username,
Email: email,
Password: string(hashed),
Nickname: username,
Role: model.RoleUser,
Role: role,
}
if err := s.db.Create(user).Error; err != nil {
return nil, err