Перенос на сервер работы с именами файлов при скачивании
This commit is contained in:
@@ -165,23 +165,19 @@ class WebSocketController {
|
||||
}
|
||||
|
||||
async getBookLink(req, ws) {
|
||||
if (!utils.hasProp(req, 'bookPath'))
|
||||
throw new Error(`bookPath is empty`);
|
||||
if (!utils.hasProp(req, 'downFileName'))
|
||||
throw new Error(`downFileName is empty`);
|
||||
if (!utils.hasProp(req, 'bookId'))
|
||||
throw new Error(`bookId is empty`);
|
||||
|
||||
const result = await this.webWorker.getBookLink({bookPath: req.bookPath, downFileName: req.downFileName});
|
||||
const result = await this.webWorker.getBookLink(req.bookId);
|
||||
|
||||
this.send(result, req, ws);
|
||||
}
|
||||
|
||||
async getBookInfo(req, ws) {
|
||||
if (!utils.hasProp(req, 'bookPath'))
|
||||
throw new Error(`bookPath is empty`);
|
||||
if (!utils.hasProp(req, 'downFileName'))
|
||||
throw new Error(`downFileName is empty`);
|
||||
if (!utils.hasProp(req, 'bookId'))
|
||||
throw new Error(`bookId is empty`);
|
||||
|
||||
const result = await this.webWorker.getBookInfo({bookPath: req.bookPath, downFileName: req.downFileName});
|
||||
const result = await this.webWorker.getBookInfo(req.bookId);
|
||||
|
||||
this.send(result, req, ws);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user