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';
|
||||
}
|
||||
|
||||
const axiosInstance = axios.create({
|
||||
withCredentials: true
|
||||
});
|
||||
|
||||
|
||||
//
|
||||
export async function getProjectFunc (owner, projectsId) {
|
||||
const url = `${baseUrl}/${owner}/${projectsId}/simple.json`;
|
||||
return axios.get(url);
|
||||
return axiosInstance.get(url);
|
||||
}
|
||||
|
||||
export async function getProjectDetailFunc (owner, projectsId) {
|
||||
const url = `${baseUrl}/${owner}/${projectsId}/detail.json`;
|
||||
return axios.get(url);
|
||||
return axiosInstance.get(url);
|
||||
}
|
||||
|
||||
export async function getProjectEntriesFunc (owner, projectsId, branch) {
|
||||
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) {
|
||||
const url = `${baseUrl}/${owner}/${projectsId}/menu_list.json`;
|
||||
return axios.get(url);
|
||||
return axiosInstance.get(url);
|
||||
}
|
||||
|
||||
export async function getProjectReadMe (owner, projectsId, branch) {
|
||||
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) {
|
||||
const url = `${baseUrl}/owners/${owner}.json`;
|
||||
return axios.get(url);
|
||||
return axiosInstance.get(url);
|
||||
}
|
||||
|
||||
|
||||
export async function getMainInfos (deptId) {
|
||||
const url = `${baseZoneUrl}/zone/open/zoneKey/${deptId}`;
|
||||
return axios.get(url);
|
||||
return axiosInstance.get(url);
|
||||
}
|
||||
|
||||
export async function getNewsDetail (id) {
|
||||
const url = `${baseZoneUrl}/cms/doc/open/${id}`;
|
||||
return axios.get(url);
|
||||
return axiosInstance.get(url);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue