diff --git a/src/api/model/cms.js b/src/api/model/cms.js new file mode 100644 index 00000000..8cb76e4d --- /dev/null +++ b/src/api/model/cms.js @@ -0,0 +1,64 @@ +import config from "@/config" +import http from "@/utils/request" +/*公告视频接口*/ +export default { + article: { + list: { + name: "获取列表", + req: async function(data){ + return await http.get( + `${config.API_URL}/cms/article/`, + data + ); + } + }, + item: { + name: "获取详情", + req: async function(id){ + return await http.get( + `${config.API_URL}/cms/article/${id}/` + ); + } + }, + cquery: { + name: "复杂查询", + req: async function(data){ + return await http.post( + `${config.API_URL}/cms/article/cquery/`, + data); + } + }, + update: { + name: "编辑更新", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/cms/article/${id}/`, + data); + } + }, + create: { + name: "新增", + req: async function(data){ + return await http.post( + `${config.API_URL}/cms/article/`, + data); + } + }, + delete: { + name: "删除", + req: async function(id){ + return await http.delete( + `${config.API_URL}/cms/article/${id}/`); + } + }, + toggle_top: { + name: "文章置顶/取消", + req: async function(id, data){ + return await http.put( + `${config.API_URL}/cms/article/${id}/toggle_top/`, + data); + } + }, + + }, +} diff --git a/src/config/route.js b/src/config/route.js index 18b17f45..6d9171e7 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -142,6 +142,15 @@ const routes = [ }, component: "home/event", }, + { + name: "articles", + path: "/articles", + meta: { + title: "公告视频", + perms: ["articles"], + }, + component: "home/articles", + }, ], }, //审批 diff --git a/src/views/home/articles.vue b/src/views/home/articles.vue new file mode 100644 index 00000000..e3c861ab --- /dev/null +++ b/src/views/home/articles.vue @@ -0,0 +1,266 @@ + + +