You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

111 lines
3.0 KiB

"use strict";
import { ApiTable } from "$utils";
import { Request } from "@peace/utils";
import { basicAction } from "@peace/utils";
// export function addArticle(articleObj) {
// return (dispatch) =>
// basicAction({
// type: "post",
// dispatch: dispatch,
// data: articleObj,
// actionType: "ADD_ARTICLE",
// url: `${ApiTable.addArticle}`,
// msg: { error: "新增文章失败" },
// reducer: { name: "articleInsertInfo" },
// });
// }
// export function editArticle(articleObj) {
// return (dispatch) =>
// basicAction({
// type: "put",
// dispatch: dispatch,
// data: articleObj,
// actionType: "EDIT_ARTICLE",
// url: `${ApiTable.addArticle}`,
// msg: { error: "编辑文章失败" },
// reducer: { name: "articleInsertInfo" },
// });
// }
// export function getDataList(query) {
// return (dispatch) =>
// basicAction({
// type: "get",
// dispatch: dispatch,
// actionType: "GET_DATALIST",
// url: ApiTable.getDataList,
// query: query,
// msg: { error: "获取文章信息失败" },
// reducer: {
// name: "articlesfrom",
// },
// });
// }
// export function delDataList(id) {
// return (dispatch) =>
// basicAction({
// type: "del",
// dispatch: dispatch,
// actionType: "DEL_DATALIST11",
// url: ApiTable.delDataList + `?id=${id}`,
// query: { id: id },
// msg: { error: "删除文章信息失败" },
// });
// }
// export const MODIFYARTICAL = {
// REQUEST_SUCCESS: "MODIFY_ARTICAL_SUCCESS",
// };
// export function setModifyData(data) {
// return (dispatch) => {
// dispatch({ type: MODIFYARTICAL.REQUEST_SUCCESS, payload: { data } });
// };
// }
export function postProject(articleObj) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data: articleObj,
actionType: "POST_PROJECT",
url: `${ApiTable.projectUrl}`,
msg: { error: "获取项目信息失败" },
// reducer: { name: "articleInsertInfo" },
});
}
export function postInProject(articleObj) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data: articleObj,
actionType: "POST_IN_PROJECT",
url: `${ApiTable.postInProject}`,
msg: { error: "上传项目信息失败" },
// reducer: { name: "articleInsertInfo" },
});
}
export function delCancel(query) {
return (dispatch) =>
basicAction({
type: "post",
dispatch: dispatch,
data: query,
actionType: "DEL_CANCEL",
url: `${ApiTable.delCancel}`,
msg: { error: "删除项目信息失败" },
// reducer: { name: "articleInsertInfo" },
});
}
export function getDownProject() {
return (dispatch) =>
basicAction({
type: "get",
dispatch: dispatch,
actionType: "DEL_CANCEL",
url: `${ApiTable.getDownProject}`,
msg: { error: "下载项目信息失败" },
// reducer: { name: "articleInsertInfo" },
});
}