From e76df10cf74cb8820480c584368fa047b77c34b9 Mon Sep 17 00:00:00 2001 From: mlogclub Date: Thu, 10 Nov 2022 20:01:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=8F=91=E5=B8=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=A0=B9=E6=8D=AE=E6=8C=89=E9=92=AE=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E6=8E=A7=E5=88=B6=E6=98=AF=E5=90=A6=E5=8F=AF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- site/layouts/error.vue | 17 +++++++++-------- site/pages/article/create.vue | 11 +++++++++++ site/pages/topic/create.vue | 18 +++++++++++++++++- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/site/layouts/error.vue b/site/layouts/error.vue index bc3476826..d14d60375 100644 --- a/site/layouts/error.vue +++ b/site/layouts/error.vue @@ -6,13 +6,14 @@
- {{ - error.message ? error.message : '页面没找到' - }} - {{ - error.message ? error.message : 'forbidden' - }} - {{ error.statusCode }} 页面异常 +
+ {{ error.message }} +
+
export default { middleware: 'authenticated', + asyncData({ store, error }) { + if (!store.getters['config/isEnabledArticle']) { + // 发帖子 + error({ + statusCode: 404, + message: '已关闭文章功能', + }) + return + } + return {} + }, data() { return { publishing: false, // 当前是否正处于发布中... diff --git a/site/pages/topic/create.vue b/site/pages/topic/create.vue index 26b6f4529..85d697ca3 100644 --- a/site/pages/topic/create.vue +++ b/site/pages/topic/create.vue @@ -121,7 +121,7 @@