chore: settings util

This commit is contained in:
Noah Hsu
2022-06-27 17:25:19 +08:00
parent 005ded41c3
commit f01a81ee9c
6 changed files with 127 additions and 105 deletions

View File

@ -41,7 +41,7 @@ func Auth(c *gin.Context) {
func AuthAdmin(c *gin.Context) {
user := c.MustGet("user").(*model.User)
if !user.IsAdmin() {
common2.ErrorStrResp(c, "You are not an admin", 403)
common2.ErrorStrResp(c, "You are not an admin", 403, true)
c.Abort()
} else {
c.Next()