Commit 1b83ec13 authored by tangtuo's avatar tangtuo

nft下载

parent a30a18db
......@@ -355,9 +355,13 @@ public class NftServiceImpl extends ServiceImpl<NftMapper, Nft> implements NftSe
if (nft == null) {
throw GlobalException.newException(ResultCode.DATA_ERROR, "没找到此nft详情");
}
String token = request.getHeader("Authorization");
Integer userId = JwtUtil.getUserIdFromToken(token);
if (!userId.equals(nft.getUserId())){
if (SystemConstant.BOOLEAN_DATA_FALSE.equals(nft.getIsArchives()) || SystemConstant.BOOLEAN_DATA_TRUE.equals(nft.getIsGrant())) {
throw GlobalException.newException(ResultCode.FILE_DOWNLOAD_ERROR, "当前文件不支持下载");
}
}
ossUtil.downloadFile(nft.getFileUrl(), nft.getFileName());
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment