forked from Gitlink/forgeplus-react
40 lines
769 B
JavaScript
40 lines
769 B
JavaScript
import fetch from '../fetch';
|
|
import { notification } from 'antd';
|
|
|
|
|
|
// 公告列表查询
|
|
export async function getNoticeList(params) {
|
|
let res = await fetch({
|
|
url: '/api/announcements/',
|
|
method: 'get',
|
|
params,
|
|
});
|
|
if (res.message === 'success') {
|
|
return res.data;
|
|
} else {
|
|
notification.open({
|
|
message: "提示",
|
|
description: res.message || '请求错误',
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
// 公告详情查询
|
|
export async function getNoticeDetail(id) {
|
|
let res = await fetch({
|
|
url: '/api/announcements/' + id,
|
|
method: 'get',
|
|
params:{flag:1}
|
|
});
|
|
if (res.message === 'success') {
|
|
return res.data;
|
|
} else {
|
|
notification.open({
|
|
message: "提示",
|
|
description: res.message || '请求错误',
|
|
});
|
|
}
|
|
}
|
|
|