update 取消下载次数限制

This commit is contained in:
lijiarao
2023-07-18 14:50:49 +08:00
parent ce3be0e51a
commit 91445d8f06
2 changed files with 18 additions and 18 deletions
@@ -323,12 +323,12 @@ public class CommonController {
ossFileService.updateById(ossFile);
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
if (loginUser.getIsCompanyUser()) {
Integer integer = ossFileService.searchDownloadTimes(ossFile.getId(), loginUser.getId());
if (integer >= 5) {
throw new JeroBootException("超出下载次数限制");
}
}
//if (loginUser.getIsCompanyUser()) {
// Integer integer = ossFileService.searchDownloadTimes(ossFile.getId(), loginUser.getId());
// if (integer >= 5) {
// throw new JeroBootException("超出下载次数限制");
// }
//}
ossFileService.saveDownloadTimes(ossFile.getId(), loginUser.getId());
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1"));