Ready to release 3.0.0

This commit is contained in:
zicla
2019-05-23 01:45:07 +08:00
parent 7f225bb18e
commit fd5f6ca32d
9 changed files with 21 additions and 16 deletions

View File

@ -168,6 +168,7 @@ func (this *UserController) Edit(writer http.ResponseWriter, request *http.Reque
avatarUrl := request.FormValue("avatarUrl")
sizeLimitStr := request.FormValue("sizeLimit")
totalSizeLimitStr := request.FormValue("totalSizeLimit")
role := request.FormValue("role")
user := this.checkUser(request)
currentUser := this.userDao.CheckByUuid(uuid)
@ -200,6 +201,10 @@ func (this *UserController) Edit(writer http.ResponseWriter, request *http.Reque
}
currentUser.TotalSizeLimit = totalSizeLimit
if role == USER_ROLE_USER || role == USER_ROLE_ADMINISTRATOR {
currentUser.Role = role
}
} else if user.Uuid != uuid {
panic(result.UNAUTHORIZED)
}