forked from Gitlink/forgeplus-react
hovercard.json 404
This commit is contained in:
parent
4183c95af3
commit
f542446177
|
@ -32,7 +32,7 @@ export function initAxiosInterceptors(props) {
|
|||
// 判断网络是否连接
|
||||
initOnlineOfflineListener();
|
||||
|
||||
var proxy = "https://testforgeplus.educoder.net";
|
||||
var proxy = "https://code.educoder.net";
|
||||
//响应前的设置
|
||||
axios.interceptors.request.use(
|
||||
config => {
|
||||
|
@ -92,7 +92,10 @@ export function initAxiosInterceptors(props) {
|
|||
|
||||
if (response.data.status === 404) {
|
||||
let responseURL = response.request ? response.request.responseURL:'';
|
||||
if (responseURL.indexOf('/api/users/') === -1 || responseURL.indexOf('/api/organizations/') === -1 || responseURL.indexOf('/api/owners/') === -1) {
|
||||
if(responseURL.indexOf("/hovercard.json") > -1){
|
||||
return;
|
||||
}
|
||||
if ((responseURL.indexOf('/api/users/') === -1) || responseURL.indexOf('/api/organizations/') === -1 || responseURL.indexOf('/api/owners/') === -1) {
|
||||
locationurl('/nopage');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,11 +42,13 @@ function Contributors({owner,projectsId,currentLogin}){
|
|||
let a = menuList && menuList.filter(i=>i.login === login);
|
||||
if(a.length === 0){
|
||||
let result = await getUser(login);
|
||||
let arr = menuList;
|
||||
arr.push({...result});
|
||||
setMenuList(arr);
|
||||
setMenusFunc(result);
|
||||
setIsSpin(false);
|
||||
if(result){
|
||||
let arr = menuList;
|
||||
arr.push({...result});
|
||||
setMenuList(arr);
|
||||
setMenusFunc(result);
|
||||
setIsSpin(false);
|
||||
}
|
||||
}else{
|
||||
setMenusFunc(a[0]);
|
||||
setIsSpin(false);
|
||||
|
|
|
@ -17,5 +17,6 @@ export const getSubEntries = async (owner,projectsId,params)=>{
|
|||
}
|
||||
// 获取用户信息
|
||||
export const getUser = async (login)=>{
|
||||
return (await axios.get(`/users/${login}/hovercard.json`)).data;
|
||||
let response = await axios.get(`/users/${login}/hovercard.json`)
|
||||
return response ? response.data : "";
|
||||
}
|
Loading…
Reference in New Issue