🎨 优化页面

This commit is contained in:
comma
2026-03-30 17:08:46 +08:00
parent 2c6c0c0e2a
commit b3dd1549db
23 changed files with 2826 additions and 624 deletions

View File

@@ -184,6 +184,9 @@ func (setting) Import(c *gin.Context) {
response.R(c).FailedWithError(err)
return
}
defer func() {
_ = fileBytes.Close()
}()
var data vo.Export
if err := json.NewDecoder(fileBytes).Decode(&data); err != nil {

View File

@@ -140,8 +140,13 @@ func (UserApi) Delete(c *gin.Context) {
return
}
loginUser := GetCurrentLoginUser(c)
if c.IsAborted() {
return
}
// 是不是自己删除自己
if id == GetCurrentLoginUser(c).Id && c.IsAborted() {
if id == loginUser.Id {
response.R(c).FailedWithError("非法操作")
return
}
@@ -178,8 +183,13 @@ func (UserApi) Status(c *gin.Context) {
return
}
loginUser := GetCurrentLoginUser(c)
if c.IsAborted() {
return
}
// 是不是自己删除自己
if id == GetCurrentLoginUser(c).Id && c.IsAborted() {
if id == loginUser.Id {
response.R(c).FailedWithError("非法操作")
return
}

View File

@@ -20,7 +20,7 @@ func InitRouter() *gin.Engine {
// 开启IP 追踪
r.ForwardedByClientIP = true
// 将请求打印至控制台
r.Use(gin.Logger())
r.Use(gin.Logger(), gin.Recovery())
if config.Config.File.Type == "local" {
r.Static("/assets", config.Config.File.Path)