Try to add share code in download api.

This commit is contained in:
zicla
2019-05-01 02:00:09 +08:00
parent cfd32089ff
commit ebd20c6db5
12 changed files with 130 additions and 102 deletions

View File

@ -94,7 +94,7 @@ func (this *AlienService) PreviewOrDownload(
tokenUser := this.userDao.CheckByUuid(downloadToken.UserUuid)
if matter.UserUuid != tokenUser.Uuid {
panic(result.CODE_WRAPPER_UNAUTHORIZED)
panic(result.UNAUTHORIZED)
}
//下载之后立即过期掉。如果是分块下载的,必须以最终获取到完整的数据为准。
@ -106,7 +106,7 @@ func (this *AlienService) PreviewOrDownload(
//判断文件的所属人是否正确
operator := this.findUser(writer, request)
if operator == nil || (operator.Role != USER_ROLE_ADMINISTRATOR && matter.UserUuid != operator.Uuid) {
panic(result.CODE_WRAPPER_UNAUTHORIZED)
panic(result.UNAUTHORIZED)
}
}