From f1bf247ed00cc53835b84864e9647a45c2472554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=88=B5=20nice?= Date: Sun, 7 Oct 2018 16:09:52 +0800 Subject: [PATCH] :bug: fixed #456 --- src/main/resources/static/admin/js/edit_page.js | 17 ++++++++++++----- .../resources/templates/admin/page/edit.html | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/main/resources/static/admin/js/edit_page.js b/src/main/resources/static/admin/js/edit_page.js index e58f98df..b79f5aa7 100644 --- a/src/main/resources/static/admin/js/edit_page.js +++ b/src/main/resources/static/admin/js/edit_page.js @@ -93,11 +93,6 @@ var vm = new Vue({ url: '/admin/api/articles/' + cid, success: function (data) { $vm.article = data.payload; - if ($vm.article.fmtType === 'markdown') { - mditor.value = data.payload.content; - } else { - htmlEditor.summernote("code", data.payload.content); - } $vm.article.createdTime = moment.unix($vm.article.created).format('YYYY-MM-DD HH:mm') $('#allowComment').toggles({ @@ -121,6 +116,18 @@ var vm = new Vue({ alert(error || '数据加载失败'); } }); + + tale.get({ + url: '/admin/api/articles/content/' + cid, + success: function (data) { + if ($vm.article.fmtType === 'markdown') { + mditor.value = data; + } else { + htmlEditor.summernote("code", data); + } + } + }); + }, autoSave: function (callback) { var $vm = this; diff --git a/src/main/resources/templates/admin/page/edit.html b/src/main/resources/templates/admin/page/edit.html index 2f4033d5..48293513 100644 --- a/src/main/resources/templates/admin/page/edit.html +++ b/src/main/resources/templates/admin/page/edit.html @@ -84,6 +84,6 @@

编辑页面

#include('../article/_footer.html') - + \ No newline at end of file