Finish the download archive feature.

This commit is contained in:
zicla
2019-05-01 19:53:20 +08:00
parent adf4b9ea5a
commit 5dd0fec953
26 changed files with 492 additions and 255 deletions

View File

@ -58,10 +58,8 @@ func (this *ImageCacheController) Detail(writer http.ResponseWriter, request *ht
//验证当前之人是否有权限查看这么详细。
user := this.checkUser(writer, request)
if user.Role != USER_ROLE_ADMINISTRATOR {
if imageCache.UserUuid != user.Uuid {
panic("没有权限查看该图片缓存")
}
if imageCache.UserUuid != user.Uuid {
panic(result.UNAUTHORIZED)
}
return this.Success(imageCache)
@ -82,9 +80,7 @@ func (this *ImageCacheController) Page(writer http.ResponseWriter, request *http
orderSize := request.FormValue("orderSize")
user := this.checkUser(writer, request)
if user.Role != USER_ROLE_ADMINISTRATOR {
userUuid = user.Uuid
}
userUuid = user.Uuid
var page int
if pageStr != "" {
@ -136,7 +132,7 @@ func (this *ImageCacheController) Delete(writer http.ResponseWriter, request *ht
//判断图片缓存的所属人是否正确
user := this.checkUser(writer, request)
if user.Role != USER_ROLE_ADMINISTRATOR && imageCache.UserUuid != user.Uuid {
if imageCache.UserUuid != user.Uuid {
panic(result.Unauthorized("没有权限"))
}
@ -162,7 +158,7 @@ func (this *ImageCacheController) DeleteBatch(writer http.ResponseWriter, reques
//判断图片缓存的所属人是否正确
user := this.checkUser(writer, request)
if user.Role != USER_ROLE_ADMINISTRATOR && imageCache.UserUuid != user.Uuid {
if imageCache.UserUuid != user.Uuid {
panic(result.Unauthorized("没有权限"))
}