发布评论者头像路径错误

This commit is contained in:
caishi 2021-04-22 10:58:11 +08:00
parent 29e3f0d59d
commit 52dc63362b
2 changed files with 26 additions and 3 deletions

View File

@ -1,9 +1,30 @@
import React from 'react';
import React, { useEffect, useState } from 'react';
import { AlignCenter , FlexAJ } from '../Component/layout';
import { Link } from 'react-router-dom';
import { Dropdown , Spin } from 'antd';
import { getImageUrl } from 'educoder';
import Axios from 'axios';
function Contributors({contributors,owner,projectsId}){
// function menuFunc(login){
// let data = undefined;
// const url = `/users/${login}.json`;
// Axios.get(url).then(result=>{
// if(result && result.data){
// data = result.data;
// }
// }).catch(error=>{})
// if(data){
// return(
// <div>111</div>
// )
// }else{
// return <Spin />
// }
// }
return(
<div>
<FlexAJ>
@ -15,7 +36,9 @@ function Contributors({contributors,owner,projectsId}){
contributors && contributors.total_count > 0 ?
contributors.list.map((item,key)=>{
return(
<Link key={key} to={`/users/${item.login}`}><img src={getImageUrl(`/${item.image_url}`)} alt=""/></Link>
// <Dropdown overlay={()=>menuFunc(item.login)}>
<Link key={key} to={`/users/${item.login}`}><img src={getImageUrl(`/${item.image_url}`)} alt=""/></Link>
// </Dropdown>
)
})
:""

View File

@ -310,7 +310,7 @@ class comments extends Component {
<img
className="radius"
src={getImageUrl(
`images/${current_user && current_user.image_url}`
`/${current_user && current_user.image_url}`
)}
alt=""
width="30"