forked from Gitlink/forgeplus-react
Merge pull request '允许携带cookie' (#697) from gitlink_ssr_head into pre_gitlink_ssr
1
This commit is contained in:
commit
05b1bb026b
|
|
@ -10,45 +10,49 @@ if (__CLIENT__) {
|
||||||
baseZoneUrl = settings && settings.common.zone + '/api';
|
baseZoneUrl = settings && settings.common.zone + '/api';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const axiosInstance = axios.create({
|
||||||
|
withCredentials: true
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
export async function getProjectFunc (owner, projectsId) {
|
export async function getProjectFunc (owner, projectsId) {
|
||||||
const url = `${baseUrl}/${owner}/${projectsId}/simple.json`;
|
const url = `${baseUrl}/${owner}/${projectsId}/simple.json`;
|
||||||
return axios.get(url);
|
return axiosInstance.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getProjectDetailFunc (owner, projectsId) {
|
export async function getProjectDetailFunc (owner, projectsId) {
|
||||||
const url = `${baseUrl}/${owner}/${projectsId}/detail.json`;
|
const url = `${baseUrl}/${owner}/${projectsId}/detail.json`;
|
||||||
return axios.get(url);
|
return axiosInstance.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getProjectEntriesFunc (owner, projectsId, branch) {
|
export async function getProjectEntriesFunc (owner, projectsId, branch) {
|
||||||
const url = `${baseUrl}/${owner}/${projectsId}/entries.json`;
|
const url = `${baseUrl}/${owner}/${projectsId}/entries.json`;
|
||||||
return axios.get(url, {params: { ref: branch }});
|
return axiosInstance.get(url, {params: { ref: branch }});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getBannerFunc (owner, projectsId) {
|
export async function getBannerFunc (owner, projectsId) {
|
||||||
const url = `${baseUrl}/${owner}/${projectsId}/menu_list.json`;
|
const url = `${baseUrl}/${owner}/${projectsId}/menu_list.json`;
|
||||||
return axios.get(url);
|
return axiosInstance.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getProjectReadMe (owner, projectsId, branch) {
|
export async function getProjectReadMe (owner, projectsId, branch) {
|
||||||
const url = `${baseUrl}/${owner}/${projectsId}/readme.json`;
|
const url = `${baseUrl}/${owner}/${projectsId}/readme.json`;
|
||||||
return axios.get(url, {params: { ref: branch }});
|
return axiosInstance.get(url, {params: { ref: branch }});
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getOwnerInfo (owner) {
|
export async function getOwnerInfo (owner) {
|
||||||
const url = `${baseUrl}/owners/${owner}.json`;
|
const url = `${baseUrl}/owners/${owner}.json`;
|
||||||
return axios.get(url);
|
return axiosInstance.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export async function getMainInfos (deptId) {
|
export async function getMainInfos (deptId) {
|
||||||
const url = `${baseZoneUrl}/zone/open/zoneKey/${deptId}`;
|
const url = `${baseZoneUrl}/zone/open/zoneKey/${deptId}`;
|
||||||
return axios.get(url);
|
return axiosInstance.get(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getNewsDetail (id) {
|
export async function getNewsDetail (id) {
|
||||||
const url = `${baseZoneUrl}/cms/doc/open/${id}`;
|
const url = `${baseZoneUrl}/cms/doc/open/${id}`;
|
||||||
return axios.get(url);
|
return axiosInstance.get(url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue