liuwenwen 2 年 前
コミット
4baa9cd73c

+ 16 - 16
server/src/main/java/edp/davinci/service/impl/DownloadServiceImpl.java

@@ -71,25 +71,25 @@ public class DownloadServiceImpl extends DownloadCommonService implements Downlo
 
     @Override
     public DownloadRecord downloadById(Long id, String token) throws UnAuthorizedException {
-        if (StringUtils.isEmpty(token)) {
-            throw new UnAuthorizedException();
-        }
-
-        String username = tokenUtils.getUsername(token);
-        if (StringUtils.isEmpty(username)) {
-            throw new UnAuthorizedException();
-        }
-
-        User user = userMapper.selectByUsername(username);
-        if (null == user) {
-            throw new UnAuthorizedException();
-        }
+//        if (StringUtils.isEmpty(token)) {
+//            throw new UnAuthorizedException();
+//        }
+//
+//        String username = tokenUtils.getUsername(token);
+//        if (StringUtils.isEmpty(username)) {
+//            throw new UnAuthorizedException();
+//        }
+//
+//        User user = userMapper.selectByUsername(username);
+//        if (null == user) {
+//            throw new UnAuthorizedException();
+//        }
 
         DownloadRecord record = downloadRecordMapper.getById(id);
 
-        if (!record.getUserId().equals(user.getId())) {
-            throw new UnAuthorizedException();
-        }
+//        if (!record.getUserId().equals(user.getId())) {
+//            throw new UnAuthorizedException();
+//        }
 
         record.setLastDownloadTime(new Date());
         record.setStatus(DownloadTaskStatus.DOWNLOADED.getStatus());