From ef7c6eb83d8c9c2ca77141ed9f2a79dfdb3dee5d Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Sun, 16 Oct 2022 20:38:03 +0800 Subject: [PATCH] feat(web/blog/write): display blog id --- web/app/controllers/subdomain/blog/blog_write.php | 13 +++++++++++++ web/js/blog-editor/blog-editor.js | 3 +++ 2 files changed, 16 insertions(+) diff --git a/web/app/controllers/subdomain/blog/blog_write.php b/web/app/controllers/subdomain/blog/blog_write.php index d0478a5..85bb219 100644 --- a/web/app/controllers/subdomain/blog/blog_write.php +++ b/web/app/controllers/subdomain/blog/blog_write.php @@ -60,6 +60,7 @@ } else { insertBlog($data); $blog = array('id' => DB::insert_id(), 'tags' => array()); + $ret['blog_id'] = $blog['id']; $ret['blog_write_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}/write"); $ret['blog_url'] = HTML::blog_url(UOJContext::user()['username'], "/post/{$blog['id']}"); } @@ -77,6 +78,18 @@
+
+
写博客
+
+ style="display: none" + + > + + 博客 ID: + +
+
printHTML() ?>
diff --git a/web/js/blog-editor/blog-editor.js b/web/js/blog-editor/blog-editor.js index ae08a2e..0bf0739 100644 --- a/web/js/blog-editor/blog-editor.js +++ b/web/js/blog-editor/blog-editor.js @@ -212,6 +212,9 @@ function blog_editor_init(name, editor_config) { if (data.blog_url) { $('#a-' + name + '_view_blog').attr('href', data.blog_url).show(); } + if (data.blog_id) { + $('#div-blog-id').html('博客 ID:' + data.blog_id + '').show(); + } } }).fail(function() { if (config.need_preview) {