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.
84 lines
2.9 KiB
84 lines
2.9 KiB
// noinspection SpellCheckingInspection
|
|
|
|
import http from 'utils/axios';
|
|
|
|
// const apiUrl = import.meta.env.VITE_API_URL;
|
|
// const users = `${apiUrl}/gateway/tall3/v3.0/users`;
|
|
// const tall = `${apiUrl}/gateway/tall3/v3.0`;
|
|
|
|
// const filedeal = `${apiUrl}/filedeal`; // 测试
|
|
// const filedeal = `http://101.201.226.21:7180`; // 生产
|
|
|
|
const apiUrl = import.meta.env.VITE_API_URL;
|
|
const tall = `${apiUrl}/ptostall`;
|
|
const experiment = `${apiUrl}/experiment`;
|
|
|
|
// 根据userId 获取token
|
|
// eslint-disable-next-line import/prefer-default-export
|
|
export const getToken = userId => http.get(`${tall}/users/userId`, { userId });
|
|
|
|
// 根据refreshToken重新获取token
|
|
export const getNewToken = refreshToken => http.get(`${tall}/users/refreshToken?refreshToken=${refreshToken}`);
|
|
|
|
// 登录api
|
|
export const signIn = params => http.post(`${tall}/users/signin`, params);
|
|
|
|
// 获取图片验证码
|
|
export const getImageCode = () => http.get(`${tall}/users/code`);
|
|
|
|
// 获取短信验证码
|
|
export const getSmsCode = params => http.get(`${tall}/users/smscode`, { params });
|
|
|
|
/**
|
|
* 项目相关
|
|
*/
|
|
|
|
// 获取项目列表
|
|
export const getProjects = (startTime, endTime) => http.post(`${tall}/project/query`, { param: { startTime, endTime } });
|
|
|
|
// 根据id获取项目信息
|
|
export const findProjectById = (projectId, url) => http.post(`${url}/tall/project/findProjectById`, { param: { projectId } });
|
|
|
|
// 删除项目
|
|
export const delProject = (projectId, url) => http.post(`${url}/tall/project/delete`, { param: { projectId } });
|
|
|
|
// 根据项目id查找角色
|
|
export const findShowRole = (projectId, url) => http.post(`${url}/tall/role/show`, { param: { projectId } });
|
|
|
|
// 根据项目id查找所有成员
|
|
export const queryChecker = param => http.post(`${tall}/deliver/queryChecker`, param);
|
|
|
|
// 查找带时间的日常任务
|
|
export const getGlobal = (params, url) => http.post(`${url}/tall/task/global`, params);
|
|
|
|
// 查找永久日常任务
|
|
export const getPermanent = (params, url) => http.post(`${url}/tall/task/permanent`, params);
|
|
|
|
// 查找定期任务
|
|
export const getRegularTask = (params, url) => http.post(`${url}/tall/task/regular/page`, params);
|
|
|
|
// 添加任务
|
|
export const saveTask = params => http.post(`${experiment}/task/save`, params);
|
|
|
|
// 查询子任务
|
|
export const findSonTask = params => http.post(`${experiment}/task/findSonTask`, params);
|
|
|
|
/**
|
|
* 导入wbs
|
|
* @param {object} e
|
|
*/
|
|
export const importWbs = async e => {
|
|
const file = e.target.files[0];
|
|
const param = new FormData();
|
|
param.append('file', file);
|
|
const config = { headers: { 'Content-Type': 'multipart/form-data' } };
|
|
const result = await http.post(`${experiment}/wbs`, param, config);
|
|
return result;
|
|
};
|
|
|
|
// 新建课题 -- 根据模板新建课题
|
|
export const create = param => http.post(`${experiment}/experiment/create`, { params: { param } });
|
|
|
|
// 上传文件
|
|
// export const uploadImg = `${filedeal}/file/upload/multiple`;
|
|
export const uploadImg = `${experiment}/import/upload`;
|
|
|