From 1cdd6608d751b2d1848e34d2d4d23b30221e77bf Mon Sep 17 00:00:00 2001 From: = <=> Date: Tue, 12 Jan 2021 10:41:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BA=A4=E4=BA=92ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- APP/static/js/wsy.js | 8 ++++++-- APP/templates/add.html | 2 +- APP/view/__pycache__/auth.cpython-37.pyc | Bin 0 -> 2774 bytes APP/view/__pycache__/block.cpython-37.pyc | Bin 0 -> 4045 bytes APP/view/__pycache__/collection.cpython-37.pyc | Bin 0 -> 5454 bytes APP/view/__pycache__/database.cpython-37.pyc | Bin 0 -> 776 bytes APP/view/__pycache__/model.cpython-37.pyc | Bin 0 -> 2573 bytes APP/view/__pycache__/start.cpython-37.pyc | Bin 0 -> 1530 bytes APP/view/block.py | 6 ++++-- APP/view/model.py | 2 +- 10 files changed, 12 insertions(+), 6 deletions(-) create mode 100644 APP/view/__pycache__/auth.cpython-37.pyc create mode 100644 APP/view/__pycache__/block.cpython-37.pyc create mode 100644 APP/view/__pycache__/collection.cpython-37.pyc create mode 100644 APP/view/__pycache__/database.cpython-37.pyc create mode 100644 APP/view/__pycache__/model.cpython-37.pyc create mode 100644 APP/view/__pycache__/start.cpython-37.pyc diff --git a/APP/static/js/wsy.js b/APP/static/js/wsy.js index b71eed8..71df8bb 100644 --- a/APP/static/js/wsy.js +++ b/APP/static/js/wsy.js @@ -97,6 +97,8 @@ function submit(content, type, order) { data.append("content", content); data.append('type', type); data.append('collection_id', page.id); + console.log(data.get('content')); + sendRequest(url, data, function () { getContent('block'); }) @@ -131,6 +133,7 @@ function getContent(type) { for (i in page.textList) { page.textList[i]['order'] = i; if (type == 'block' && page.textList[i]['type'] == 'picture') { + console.log(page.textList[i]); page.textList[i]['content'] = get_url(page.textList[i]['content']); } @@ -177,9 +180,10 @@ async function checkLike(list) { } function get_url(f) { let reader = new FileReader(); + console.log(f); reader.readAsDataURL(f); reader.onload = function (e) { - return e.target.result; + return e.target.files[0] || e.dataTransfer.files[0]; }; } @@ -331,7 +335,7 @@ var recommend = new Vue({ jump_to: function (url, block_name) { cookie.setCookie('name',block_name); cookie.setCookie('id',null); - window.location.href = "%%url_for('"+url+"')%%"; + window.location.href = "/add"; }, like: function (order) { var obj = this.textList[order]; diff --git a/APP/templates/add.html b/APP/templates/add.html index 053ec1f..bae7744 100644 --- a/APP/templates/add.html +++ b/APP/templates/add.html @@ -470,7 +470,7 @@ aria-expanded="false" class="text-white btn btn-link" v-if="id!='null'"> -