mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-03 23:52:51 +08:00
修复书籍下载链接全返回读一本书下载链接问题
This commit is contained in:
@@ -485,8 +485,10 @@
|
|||||||
var fileObjectList = {};
|
var fileObjectList = {};
|
||||||
for (let i = 0; i < data.fileObject.length; i++) {
|
for (let i = 0; i < data.fileObject.length; i++) {
|
||||||
const element = data.fileObject[i];
|
const element = data.fileObject[i];
|
||||||
|
|
||||||
if (!fileObjectList[element.fileId])
|
if (!fileObjectList[element.fileId])
|
||||||
fileObjectList[element.fileId] = [];
|
fileObjectList[element.fileId] = [];
|
||||||
|
|
||||||
fileObjectList[element.fileId].push(getLinkDOM(element));
|
fileObjectList[element.fileId].push(getLinkDOM(element));
|
||||||
|
|
||||||
// 从文件中找到fileSha1, fileName, fileExt,并填入文件对象中,否则下载时获取不到
|
// 从文件中找到fileSha1, fileName, fileExt,并填入文件对象中,否则下载时获取不到
|
||||||
@@ -503,7 +505,7 @@
|
|||||||
|
|
||||||
direckLinkInfo[element.id] = element;
|
direckLinkInfo[element.id] = element;
|
||||||
}
|
}
|
||||||
console.log(fileObjectList);
|
console.log("fileObjectList", fileObjectList);
|
||||||
|
|
||||||
// 再处理文件
|
// 再处理文件
|
||||||
var fileContainer = document.getElementById("file-container");
|
var fileContainer = document.getElementById("file-container");
|
||||||
|
@@ -54,7 +54,7 @@ public class FileController extends BaseController {
|
|||||||
@ApiOperation(value = "书籍下载页面获取文件提供的下载方式", notes = "")
|
@ApiOperation(value = "书籍下载页面获取文件提供的下载方式", notes = "")
|
||||||
@RequestMapping(value = "getFileByBookId", method = {RequestMethod.GET})
|
@RequestMapping(value = "getFileByBookId", method = {RequestMethod.GET})
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public CommonReturnType getFileByBookId(@RequestParam(value = "bookId", required = false) Integer bookId) throws BusinessException, InvocationTargetException, IllegalAccessException {
|
public CommonReturnType getFileByBookId(@RequestParam(value = "bookId", required = true) Integer bookId) throws BusinessException, InvocationTargetException, IllegalAccessException {
|
||||||
|
|
||||||
List<FileModel> fileModels = fileService.getFileByBookId(bookId);
|
List<FileModel> fileModels = fileService.getFileByBookId(bookId);
|
||||||
List<FileVO> fileVOS = new ArrayList<>();
|
List<FileVO> fileVOS = new ArrayList<>();
|
||||||
|
@@ -161,7 +161,7 @@
|
|||||||
SELECT
|
SELECT
|
||||||
<include refid="Base_Column_List" />
|
<include refid="Base_Column_List" />
|
||||||
FROM `file_object_info`
|
FROM `file_object_info`
|
||||||
WHERE file_id IN (SELECT id AS file_id FROM `file_info` WHERE book_id = 1)
|
WHERE file_id IN (SELECT id AS file_id FROM `file_info` WHERE book_id = #{bookId})
|
||||||
AND upload_status = 'SUCCESS'
|
AND upload_status = 'SUCCESS'
|
||||||
</select>
|
</select>
|
||||||
<select id="selectByFileId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
<select id="selectByFileId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
||||||
|
Reference in New Issue
Block a user