From 5435bc6482f00bcec1cee883eab03d2323825191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Wed, 6 Jan 2021 20:20:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B9=A6=E6=9C=AC=E8=AF=BB?= =?UTF-8?q?=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.html | 2 +- src/js/app.js | 2 +- src/main.js | 4 ++-- src/tools/socket.js | 1 + ... canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" | 1 + 5 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 "{\"undefined\":[{\"title\":\"HTML5 canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" diff --git a/src/index.html b/src/index.html index 6fac36e..238b420 100644 --- a/src/index.html +++ b/src/index.html @@ -28,7 +28,7 @@
- + {{it.title}} diff --git a/src/js/app.js b/src/js/app.js index 4c15159..dc3ad95 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -77,7 +77,7 @@ Anot({ while (this.load.curr < this.load.num) { this.load.curr++ let book = files.pop() - let res = app.dispatch('parse-book', { book, cate: this.burr }) + let res = app.dispatch('parse-book', { book, cate: this.curr }) console.log(res) if (res) { this.books.push(res) diff --git a/src/main.js b/src/main.js index 5fb2ee4..2cb7969 100644 --- a/src/main.js +++ b/src/main.js @@ -65,11 +65,11 @@ app.once('ready', () => { }) protocol.registerStreamProtocol('book', function(req, cb) { - var file = decodeURIComponent(req.url.replace(/^book:[\/]+/, '/')) + var file = decodeURIComponent(req.url.replace(/^book:[\/]+cache/, './')) var ext = path.extname(file) file = path.resolve(CACHE_DIR, file) - + console.log(file) cb({ data: fs.origin.createReadStream(file), mimeType: MIME_TYPES[ext] || MIME_TYPES.all, diff --git a/src/tools/socket.js b/src/tools/socket.js index 6cd0b8f..656da4b 100644 --- a/src/tools/socket.js +++ b/src/tools/socket.js @@ -113,6 +113,7 @@ module.exports = function(app) { } else { cache[cate] = [info] } + fs.echo(JSON.stringify(cache), DB_FILE) ev.returnValue = info }) diff --git "a/{\"undefined\":[{\"title\":\"HTML5 canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" "b/{\"undefined\":[{\"title\":\"HTML5 canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" new file mode 100644 index 0000000..0864ee2 --- /dev/null +++ "b/{\"undefined\":[{\"title\":\"HTML5 canvas开发详解(第2版) (无)\",\"cover\":\"cover.jpeg\"}]}" @@ -0,0 +1 @@ +/Users/yutent/Library/Application Support/org.bytedo.epub/app.cache \ No newline at end of file