统一角色体系为admin/agent/user,修复代理查询角色错误,添加语言切换和明暗切换
This commit is contained in:
@@ -130,7 +130,7 @@ func handleRegister(c *gin.Context) {
|
||||
req.Username, req.Email, req.Phone, req.Role, req.Type)
|
||||
|
||||
if req.Role == "" {
|
||||
req.Role = "developer"
|
||||
req.Role = "admin"
|
||||
}
|
||||
|
||||
username := req.Username
|
||||
@@ -794,7 +794,7 @@ func handleGetPublicStats(c *gin.Context) {
|
||||
var totalApps, totalUsers, totalVerifications int64
|
||||
|
||||
database.DB.Model(&model.Application{}).Count(&totalApps)
|
||||
database.DB.Model(&model.User{}).Where("role = ?", "developer").Count(&totalUsers)
|
||||
database.DB.Model(&model.User{}).Where("role = ?", "admin").Count(&totalUsers)
|
||||
database.DB.Model(&model.Card{}).Where("status = ?", "used").Count(&totalVerifications)
|
||||
|
||||
response.Success(c, gin.H{
|
||||
|
||||
Reference in New Issue
Block a user