From dc9387a4d1e46b8095d983e70a8390e30d36600c Mon Sep 17 00:00:00 2001 From: Shu Guang <61069967+shuguangnet@users.noreply.github.com> Date: Sat, 17 May 2025 22:29:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 10 +++++----- src/views/account/center/index.vue | 9 ++++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 8de3639d..978bbfc1 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -104,15 +104,15 @@ export const routes = [ component: () => import('@/components/edit/tinymce.vue'), }, { - path: '/community/editcontent', - name: 'editcontent', - meta: { title: '修改帖子', auth: [0, 1, 2], hidden: true }, - component: () => import('@/components/edit/EditContent.vue'), + path: '/community/edit', + name: 'EditArticle', + component: () => import('@/components/edit/EditContent'), + meta: { title: '编辑文章', auth: [0, 1, 2] }, }, { path: '/community/pages', name: 'pages', - meta: { title: '帖子详细', auth: [0, 1, 2] }, + meta: { title: '帖子详细', auth: [0, 1, 2], hidden: true }, component: () => import('@/views/communtiy/pages.vue'), }, { diff --git a/src/views/account/center/index.vue b/src/views/account/center/index.vue index 48ff99bb..16e3769d 100644 --- a/src/views/account/center/index.vue +++ b/src/views/account/center/index.vue @@ -263,8 +263,12 @@ export default { this.fetchStats(); }, methods: { - editArticle(id) { - this.$router.push(`/article/edit/${id}`); + editArticle(article) { + // 使用query参数格式 + this.$router.push({ + path: "/community/edit", + query: { id: article.articleId }, + }); }, deleteItemArticle(article) { // 参数重命名为article @@ -272,7 +276,6 @@ export default { title: "提示", content: "确定要删除这篇文章吗?", onOk: () => { - // 直接传递articleId作为参数 DeteleArticleById(article.articleId) .then((res) => { this.$message.success("删除成功");