🎨 优化页面
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user