Fix a large number of bugs

This commit is contained in:
2026-03-19 05:11:44 +08:00
parent f1d657172e
commit 79669376aa
15 changed files with 570 additions and 289 deletions

View File

@@ -3,6 +3,7 @@ package admin
import (
"NetworkAuth/controllers"
"NetworkAuth/models"
"NetworkAuth/services"
"crypto/rand"
"encoding/base64"
"encoding/hex"
@@ -385,6 +386,20 @@ func AppCreateHandler(c *gin.Context) {
return
}
// 记录操作日志
operator := c.GetString("admin_username")
if operator == "" {
operator = "unknown"
}
operatorUUID := c.GetString("admin_uuid")
services.RecordOperationLog(
"创建应用",
operator,
operatorUUID,
"创建了应用: "+app.Name,
)
logrus.WithField("app_uuid", app.UUID).Debug("Successfully created app with default APIs")
c.JSON(http.StatusOK, gin.H{
@@ -555,6 +570,20 @@ func AppDeleteHandler(c *gin.Context) {
return
}
// 记录操作日志
operator := c.GetString("admin_username")
if operator == "" {
operator = "unknown"
}
operatorUUID := c.GetString("admin_uuid")
services.RecordOperationLog(
"删除应用",
operator,
operatorUUID,
"删除了应用: "+app.Name,
)
logrus.WithFields(logrus.Fields{
"app_id": app.ID,
"app_uuid": app.UUID,