|
@@ -1,176 +1,81 @@
|
|
|
-import http from '@/support/http';
|
|
|
-import { Message } from '@element-plus/icons-vue/dist/types';
|
|
|
+import http from '@/api/http';
|
|
|
|
|
|
* 通知分类列表
|
|
|
*/
|
|
|
export function noticesTypesList(params: object) {
|
|
|
- return http.get('/contentManage/notices/types/list', params).then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.get('/system/notices/types/list', params);
|
|
|
}
|
|
|
|
|
|
* 通知管理的公告列表
|
|
|
*/
|
|
|
export function noticesList(params: object) {
|
|
|
- return http.get('/contentManage/notices/notice/list', params).then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.get('/system/notices/notice/list', params);
|
|
|
}
|
|
|
|
|
|
* 添加公告分类
|
|
|
*/
|
|
|
export function noticesTypesAdd(params: object) {
|
|
|
- return http.post('/contentManage/notices/types/add', params).then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.post('/system/notices/types/add', params);
|
|
|
}
|
|
|
|
|
|
* 删除公告分类
|
|
|
*/
|
|
|
export function noticesTypesDel(id: number | string, params: object) {
|
|
|
- return http
|
|
|
- .post(`/contentManage/notices/types/del/${id}`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.post(`/system/notices/types/del/${id}`, params);
|
|
|
}
|
|
|
|
|
|
* 添加公告
|
|
|
*/
|
|
|
export function noticesAdd(params: object) {
|
|
|
- return http.post('/contentManage/notices/notice/add', params).then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.post('/system/notices/notice/add', params);
|
|
|
}
|
|
|
|
|
|
|
|
|
* 保存编辑公告
|
|
|
*/
|
|
|
export function noticesEdit(id: number | string, params: object) {
|
|
|
- return http
|
|
|
- .post(`/contentManage/notices/notice/edit/${id}`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.post(`/system/notices/notice/edit/${id}`, params);
|
|
|
}
|
|
|
|
|
|
|
|
|
* 删除公告
|
|
|
*/
|
|
|
export function noticesdel(id: number | string, params: object) {
|
|
|
- return http
|
|
|
- .post(`/contentManage/notices/notice/del/${id}`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.post(`/system/notices/notice/del/${id}`, params);
|
|
|
}
|
|
|
|
|
|
* 获取公告通知对象选择项
|
|
|
*/
|
|
|
export function noticesObjOption(params: object) {
|
|
|
- return http
|
|
|
- .post(`/contentManage/notices/notice/obj_option`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.post(`/system/notices/notice/obj_option`, params);
|
|
|
}
|
|
|
|
|
|
* 我的公告列表
|
|
|
*/
|
|
|
export function noticeListMine(params: object) {
|
|
|
- return http.get(`/contentManage/notices/notice/mine`, params).then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.get(`/system/notices/notice/mine`, params);
|
|
|
}
|
|
|
|
|
|
* 用户查看详情
|
|
|
*/
|
|
|
export function noticeDetail(id: string | number, params?: object) {
|
|
|
- return http
|
|
|
- .get(`/contentManage/notices/notice/detail/${id}`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.get(`/system/notices/notice/detail/${id}`, params);
|
|
|
}
|
|
|
|
|
|
* 用户设置已读
|
|
|
*/
|
|
|
export function noticeRead(id: string | number, params?: object) {
|
|
|
- return http
|
|
|
- .get(`/contentManage/notices/notice/read/${id}`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.get(`/system/notices/notice/read/${id}`, params);
|
|
|
}
|
|
|
|
|
|
* 用户删除
|
|
|
*/
|
|
|
export function noticeUserDel(id: string | number, params?: object) {
|
|
|
- return http
|
|
|
- .get(`/contentManage/notices/notice/user_del/${id}`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+ return http.get(`/system/notices/notice/user_del/${id}`, params);
|
|
|
}
|
|
|
|
|
|
* 获取一条弹窗
|
|
|
*/
|
|
|
-export function noticePopup( params?: object) {
|
|
|
- return http
|
|
|
- .get(`/contentManage/notices/notice/popup`, params)
|
|
|
- .then(res => {
|
|
|
- const r = res.data;
|
|
|
- const code = r.code;
|
|
|
- if (code === 1e4) {
|
|
|
- return r;
|
|
|
- }
|
|
|
- });
|
|
|
+export function noticePopup(params?: object) {
|
|
|
+ return http.get(`/system/notices/notice/popup`, params);
|
|
|
}
|