From 3b536e0cad5778eb6763ee7850028a69f1d12a67 Mon Sep 17 00:00:00 2001 From: fwb Date: Fri, 23 Aug 2024 14:59:10 +0800 Subject: [PATCH] 'news' --- .env.development | 4 +- src/api/user/news.js | 17 + src/router/routers.ts | 10 +- src/views/news/components/newsContent.vue | 11 - .../news/components/newsContentDetails.vue | 37 ++ src/views/news/index.vue | 315 +++++++++++++++--- 6 files changed, 330 insertions(+), 64 deletions(-) delete mode 100644 src/views/news/components/newsContent.vue create mode 100644 src/views/news/components/newsContentDetails.vue diff --git a/.env.development b/.env.development index 79d28f0..289450f 100644 --- a/.env.development +++ b/.env.development @@ -9,7 +9,7 @@ VITE_APP_BASE_API = 'http://39.106.16.162:8080' http://localhost:5173/#/courseResourcesManagement/courseResources >>>>>>> b0c11f6676b1ee245db7ea30ff02485e14c91a32 ======= -VITE_APP_BASE_API = 'http://127.0.0.1:8080' -# VITE_APP_BASE_API = 'http://39.106.16.162:8080' +# VITE_APP_BASE_API = 'http://127.0.0.1:8080' +VITE_APP_BASE_API = 'http://39.106.16.162:8080' http://localhost:5173/#/courseResourcesManagement/courseResources >>>>>>> 72be77b12b37cb07a7dd807572ca24163c368ce0 diff --git a/src/api/user/news.js b/src/api/user/news.js index 3ee2d22..245f9ae 100644 --- a/src/api/user/news.js +++ b/src/api/user/news.js @@ -23,3 +23,20 @@ export function addCategory(params) { const str = parseParams(params) return request.post(`/api/cms-category/add${str}`); } +//查询新闻文章 +export function queryEssay(category_id) { + return request.get(`/api/cms-essay/query?category_id=${category_id}`); +} +//添加新闻文章 +export function addEssay(params){ + const str = parseParams(params) + return request.post(`/api/cms-essay/add${str}`) +} +//删除新闻 +export function deleteEssay(ids) { + return request.delete(`/api/cms-essay/delete?ids=${ids}`); +} +//修改新闻 +export function editEssay(params) { + return request.put(`/api/cms-essay/edit`, params); +} \ No newline at end of file diff --git a/src/router/routers.ts b/src/router/routers.ts index 20703d8..a7d8844 100644 --- a/src/router/routers.ts +++ b/src/router/routers.ts @@ -249,13 +249,13 @@ export const constantRoute: any = [ } }, { - path: '/newsDetails', - component:()=>import('@/views/news/components/newsContent.vue'), - name:'NewsDetails', + path: '/news/newsContentDetails', + component:()=>import('@/views/news/components/newsContentDetails.vue'), + name:'NewsContentDetails', meta: { - title: '新闻详情', + title: '栏目添加新闻信息', hidden: true, - icon: '' + icon: 'Promotion' }, }, ] diff --git a/src/views/news/components/newsContent.vue b/src/views/news/components/newsContent.vue deleted file mode 100644 index eedd408..0000000 --- a/src/views/news/components/newsContent.vue +++ /dev/null @@ -1,11 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/news/components/newsContentDetails.vue b/src/views/news/components/newsContentDetails.vue new file mode 100644 index 0000000..8b26f56 --- /dev/null +++ b/src/views/news/components/newsContentDetails.vue @@ -0,0 +1,37 @@ + + + + + \ No newline at end of file diff --git a/src/views/news/index.vue b/src/views/news/index.vue index 825c4bc..d006122 100644 --- a/src/views/news/index.vue +++ b/src/views/news/index.vue @@ -8,20 +8,28 @@
- 关于我们 - 栏目编辑 + 栏目管理
@@ -38,7 +46,7 @@ 操作 @@ -54,24 +62,24 @@ - - - - - - - - + + + + + + + + - - - + + +