From 54afda80e11cc3f34ca3409a3b692ba95b646574 Mon Sep 17 00:00:00 2001 From: Hacker-00001 <335942189@qq.com> Date: Tue, 3 Jun 2025 19:46:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=88=A0=E9=99=A4=E5=B8=96?= =?UTF-8?q?=E5=AD=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application-local.yaml | 56 +++++++++---------- .../src/main/resources/db/luojia_channel.sql | 1 + .../vue-frontend/src/views/UserPage.vue | 39 ++++++++++++- 3 files changed, 65 insertions(+), 31 deletions(-) diff --git a/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/application-local.yaml b/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/application-local.yaml index 00a8f8c..7f22acc 100644 --- a/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/application-local.yaml +++ b/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/application-local.yaml @@ -17,38 +17,38 @@ # accessKey: forely # secretKey: Forely123! -#lj: -# db: -# host: 192.168.125.128 -# password: MySQL@5678 -# redis: -# host: 192.168.125.128 -# port: 6379 -# password: Redis@9012 -# rabbitmq: -# host: 192.168.125.128 -# port: 5672 -# username: rabbit_admin -# password: Rabbit@3456 -# minio: -# endpoint: http://192.168.125.128:9000 -# accessKey: minio_admin -# secretKey: Minio@1234 - lj: db: - host: localhost - password: 123456 + host: 192.168.125.128 + password: MySQL@5678 redis: - host: localhost + host: 192.168.125.128 port: 6379 - password: 123456 + password: Redis@9012 rabbitmq: - host: localhost + host: 192.168.125.128 port: 5672 - username: guest - password: guest + username: rabbit_admin + password: Rabbit@3456 minio: - endpoint: http://localhost:9005 - accessKey: leezt - secretKey: lzt264610 + endpoint: http://192.168.125.128:9000 + accessKey: minio_admin + secretKey: Minio@1234 + +#lj: +# db: +# host: localhost +# password: 123456 +# redis: +# host: localhost +# port: 6379 +# password: 123456 +# rabbitmq: +# host: localhost +# port: 5672 +# username: guest +# password: guest +# minio: +# endpoint: http://localhost:9005 +# accessKey: leezt +# secretKey: lzt264610 diff --git a/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/db/luojia_channel.sql b/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/db/luojia_channel.sql index f8c0afe..c868a8c 100644 --- a/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/db/luojia_channel.sql +++ b/珞珈岛-项目相关文件/luojia-island/service/src/main/resources/db/luojia_channel.sql @@ -1,3 +1,4 @@ +USE luojia_channel; -- 指定目标数据库 ## 用户表 DROP TABLE IF EXISTS `user`; diff --git a/珞珈岛-项目相关文件/luojia-island/vue-frontend/src/views/UserPage.vue b/珞珈岛-项目相关文件/luojia-island/vue-frontend/src/views/UserPage.vue index 2606d67..2cddeb7 100644 --- a/珞珈岛-项目相关文件/luojia-island/vue-frontend/src/views/UserPage.vue +++ b/珞珈岛-项目相关文件/luojia-island/vue-frontend/src/views/UserPage.vue @@ -103,9 +103,10 @@

{{ post.summary }}

- {{ post.viewCount || 0 }} - {{ post.likeCount || 0 }} - {{ post.commentCount || 0 }} + 热度 {{ post.viewCount || 0 }} + 评论 {{ post.commentCount || 0 }} + 赞 {{ post.likeCount || 0 }} + 删除
@@ -306,6 +307,26 @@ const loadUserPosts = async () => { } }; + +//删除帖子 +const deletePost = async (postId) => { + if (!postId) return; + if (!confirm('确定要删除这条帖子吗?')) return; + try { + const res = await request.delete('/post', { params: { id: postId } }); + if (res && res.code === 200) { + // 删除本地列表中的帖子 + userPosts.value = userPosts.value.filter(post => post.id !== postId); + ElMessage.success('删除成功'); + } else { + ElMessage.error(res.message || '删除失败'); + } + } catch (e) { + ElMessage.error(e.response?.message || '删除失败'); + } +}; + + // 加载更多帖子 const loadMorePosts = () => { loadUserPosts(); @@ -752,4 +773,16 @@ onUnmounted(() => { color: #999; margin-top: 4px; } + +.delete-btn { + right: 16px; + bottom: 12px; + color: #fff; + background: #f56c6c; + border: none; + border-radius: 4px; + padding: 4px 12px; + cursor: pointer; + font-size: 12px; +} \ No newline at end of file