Jsl-OA-Web-Re/src/api/manage.js
2024-04-17 00:52:58 +08:00

72 lines
1.4 KiB
JavaScript

import axios from "axios";
function getCurrentTimestamp() {
return new Date().getTime();
}
const api = 'http://nbxt.oa.x-lf.cn'
/**
* 根据项目id获取项目信息
* @param id 项目id
* @param token 访问令牌
* @returns {Promise<AxiosResponse<any>> | *}
*/
const projectGetById = (id, token) => {
return axios({
url: api + "/project/get/id?id=" + id,
method: "get",
headers: {
'Authorization': 'Bearer ' + token,
'Timestamp': getCurrentTimestamp()
}
})
}
/**
* 获取项目信息
* @param projectId 项目id
* @param token 访问令牌
* @returns {Promise<AxiosResponse<any>> | *}
*/
export const getproject = (projectId, token) => {
return axios({
url: api +"/project/get?projectId=" + projectId,
method: "get",
headers: {
'Authorization': 'Bearer ' + token,
'Timestamp': getCurrentTimestamp()
}
})
}
/**
* 获取项目信息
* @param projectId 项目id
* @param token 访问令牌
* @returns {Promise<AxiosResponse<any>> | *}
*/
export const searchModel = (projectId ,token) => {
return axios({
url: api +"/module/get?projectId=" + projectId ,
method: "get",
headers: {
'Authorization': 'Bearer ' + token,
'Timestamp': getCurrentTimestamp()
}
})
}