Refine the directory structure of this project.
This commit is contained in:
@ -3,6 +3,7 @@ package rest
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"tank/rest/result"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -96,7 +97,7 @@ func (this *AlienService) PreviewOrDownload(
|
||||
|
||||
tokenUser := this.userDao.CheckByUuid(downloadToken.UserUuid)
|
||||
if matter.UserUuid != tokenUser.Uuid {
|
||||
panic(CODE_WRAPPER_UNAUTHORIZED)
|
||||
panic(result.CODE_WRAPPER_UNAUTHORIZED)
|
||||
}
|
||||
|
||||
//下载之后立即过期掉。如果是分块下载的,必须以最终获取到完整的数据为准。
|
||||
@ -108,7 +109,7 @@ func (this *AlienService) PreviewOrDownload(
|
||||
//判断文件的所属人是否正确
|
||||
operator := this.findUser(writer, request)
|
||||
if operator == nil || (operator.Role != USER_ROLE_ADMINISTRATOR && matter.UserUuid != operator.Uuid) {
|
||||
panic(CODE_WRAPPER_UNAUTHORIZED)
|
||||
panic(result.CODE_WRAPPER_UNAUTHORIZED)
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user