|
|
@@ -41,6 +41,7 @@ export const newSaveAPI = (data: NewsSaveApiType) => {
|
|
|
export const getNewsListAPI = (data: NewsTableApiType) => {
|
|
|
return async (dispatch: AppDispatch) => {
|
|
|
const res = await http.post("cms/news/getList", data);
|
|
|
+
|
|
|
dispatch({
|
|
|
type: "news/getList",
|
|
|
payload: res.data,
|
|
|
@@ -51,20 +52,20 @@ export const getNewsListAPI = (data: NewsTableApiType) => {
|
|
|
/**
|
|
|
* 删除
|
|
|
*/
|
|
|
-export const newRemoveAPI = (id:number) => {
|
|
|
+export const newRemoveAPI = (id: number) => {
|
|
|
return http.get(`cms/news/remove/${id}`);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 详情
|
|
|
*/
|
|
|
-export const getNewsDetailAPI = (id:number) => {
|
|
|
+export const getNewsDetailAPI = (id: number) => {
|
|
|
return http.get(`cms/news/detail/${id}`);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 拖动排序
|
|
|
*/
|
|
|
-export const newSortApi = (id1:number,id2:number) => {
|
|
|
+export const newSortApi = (id1: number, id2: number) => {
|
|
|
return http.get(`cms/news/sort/${id1}/${id2}`);
|
|
|
-};
|
|
|
+};
|