forked from Gitlink/forgeplus-react
imageurl接口统一返回带iamges的字段
This commit is contained in:
parent
1f6a4bda6c
commit
798d919447
|
@ -33,7 +33,7 @@ class ActivityItem extends Component {
|
|||
}
|
||||
<p className="itemLine mt10">
|
||||
<Link to={`/users/${item && item.user_login}`} className="show-user-link">
|
||||
<img alt="" src={getImageUrl(`images/${item.user_avatar}`)} className="createImage" />
|
||||
<img alt="" src={getImageUrl(`/${item.user_avatar}`)} className="createImage" />
|
||||
<span className="mr20">{item.user_name}</span>
|
||||
</Link>
|
||||
{item.created_at && <span className="color-grey-9">创建于<span className="ml2 color-grey-6">{item.created_at}</span></span>}
|
||||
|
|
|
@ -42,7 +42,7 @@ function AddMember({getID,login}){
|
|||
className="user_img radius"
|
||||
width="28"
|
||||
height="28"
|
||||
src={getImageUrl(`images/${item && item.image_url}`)}
|
||||
src={getImageUrl(`/${item && item.image_url}`)}
|
||||
alt=""
|
||||
/>
|
||||
<span className="ml10" style={{ "vertical-align": "middle" }}>
|
||||
|
|
|
@ -6,7 +6,7 @@ import './Component.scss';
|
|||
function Cards({img , title, desc , rightBtn , src}){
|
||||
return(
|
||||
<div className="cards">
|
||||
{img &&<div className="img"><img src={getImageUrl(`images/${img}`)} alt=""/></div>}
|
||||
{img &&<div className="img"><img src={getImageUrl(`/${img}`)} alt=""/></div>}
|
||||
<div className="content">
|
||||
<p className="titles">
|
||||
<Link to={src}>{title}</Link>
|
||||
|
|
|
@ -15,7 +15,7 @@ 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(`images/${item.image_url}`)} alt=""/></Link>
|
||||
<Link key={key} to={`/users/${item.login}`}><img src={getImageUrl(`/${item.image_url}`)} alt=""/></Link>
|
||||
)
|
||||
})
|
||||
:""
|
||||
|
|
|
@ -45,7 +45,7 @@ const Div = styled.div`{
|
|||
export default (({ user , img, name, time, focusStatus, is_current_user, login , successFunc }) => {
|
||||
return (
|
||||
<Div>
|
||||
<Link to={`/users/${user && user.login}`}><Img src={getImageUrl(`images/${img}`)} /></Link>
|
||||
<Link to={`/users/${user && user.login}`}><Img src={getImageUrl(`/${img}`)} /></Link>
|
||||
<div className="m-infos">
|
||||
<Link to={`/users/${user && user.login}`}><Name>{name}</Name></Link>
|
||||
<Time><I className="iconfont icon-shijian"></I>加入时间:{time}</Time>
|
||||
|
|
|
@ -44,7 +44,7 @@ export default ({ getUser })=>{
|
|||
className="user_img radius"
|
||||
width="28"
|
||||
height="28"
|
||||
src={getImageUrl(`images/${item && item.image_url}`)}
|
||||
src={getImageUrl(`/${item && item.image_url}`)}
|
||||
alt=""
|
||||
/>
|
||||
<span className="ml10" style={{ "vertical-align": "middle" }}>
|
||||
|
|
|
@ -704,7 +704,7 @@ class NewHeader extends Component {
|
|||
<div className="ml30 edu-menu-panel" style={{ height: "70px", lineHeight: "70px" }}>
|
||||
<a href={`/users/${this.props.current_user === undefined ? "" : this.props.current_user.login}/courses`}>
|
||||
<img alt="头像" className="radius" height="34" id="nh_user_logo" name="avatar_image"
|
||||
src={getImageUrl(`images/` + user.image_url)} width="34">
|
||||
src={getImageUrl(`/` + user.image_url)} width="34">
|
||||
</img>
|
||||
</a>
|
||||
<ul className="edu-menu-list" style={{ top: '60px', textAlign: 'center' }}>
|
||||
|
|
|
@ -308,7 +308,7 @@ function CoderDepot(props){
|
|||
{
|
||||
lastCommit &&
|
||||
<div className="listtablehead">
|
||||
<User url={getImageUrl(`images/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} />
|
||||
<User url={getImageUrl(`/${lastCommitAuthor && lastCommitAuthor.image_url}`)} name={lastCommitAuthor && lastCommitAuthor.name} />
|
||||
<div className={hideBtn && hide ? "ellipsistxt hide" :"ellipsistxt"}><p id="ptxt">{lastCommit && lastCommit.message}</p></div>
|
||||
{ hideBtn && <span className="ellipsis" onClick={()=>changeHide(hide)}><i className="iconfont icon-shenglvehao"></i></span> }
|
||||
|
||||
|
|
|
@ -140,11 +140,11 @@ class CoderRootCommit extends Component{
|
|||
{
|
||||
item.id ?
|
||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
||||
{item.image_url?<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
||||
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
|
||||
</Link>:
|
||||
<span className="show-user-link">
|
||||
{item.image_url?<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
||||
{item.image_url?<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr15 radius"/>:""}
|
||||
<label className="font-14 color-grey-6" style={{verticalAlign:'middle'}}>{item.name ?`${item.name}:`:""}提交于 {item.time_from_now}</label>
|
||||
</span>
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ function Contribute(props){
|
|||
list.map((item,key)=>{
|
||||
return(
|
||||
<AlignCenter>
|
||||
<img alt="" style={{borderRadius:"50%",marginRight:"10px"}} src={getImageUrl(`images/${item.image_url}`)} width="50px" height="50px"/>
|
||||
<img alt="" style={{borderRadius:"50%",marginRight:"10px"}} src={getImageUrl(`/${item.image_url}`)} width="50px" height="50px"/>
|
||||
<div>
|
||||
<Link to={`/users/${item.login}`} className="font-16">{item.name}</Link>
|
||||
<p className="font-12 color-grey-9">提交{item.contributions}次</p>
|
||||
|
|
|
@ -22,7 +22,7 @@ function Commits({ commits , projectsId , owner }){
|
|||
<Link to={`/projects/${owner}/${projectsId}/commits/${truncateCommitId(item.sha)}`} className="color-blue">浏览代码</Link>
|
||||
</FlexAJ>
|
||||
<AlignCenter className="mt15">
|
||||
<User url={getImageUrl(`images/${item.committer && item.committer.image_url}`)} name={`${item.committer && item.committer.name}`}></User><span>:提交于{item.time_from_now}</span>
|
||||
<User url={getImageUrl(`/${item.committer && item.committer.image_url}`)} name={`${item.committer && item.committer.name}`}></User><span>:提交于{item.time_from_now}</span>
|
||||
</AlignCenter>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -74,7 +74,7 @@ class MergeItem extends Component {
|
|||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(`images/${item && item.avatar_url}`)}
|
||||
src={getImageUrl(`/${item && item.avatar_url}`)}
|
||||
alt=""
|
||||
width="24"
|
||||
height="24"
|
||||
|
|
|
@ -101,7 +101,7 @@ class MergeSubmit extends Component{
|
|||
render: (text,item) => (
|
||||
<span className="f-wrap-alignCenter">
|
||||
<Link to={`/users/${item.login}`} className="show-user-link">
|
||||
<img src={getImageUrl(`images/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
||||
<img src={getImageUrl(`/${item.image_url}`)} alt="" width="28px" height="28px" className="mr3 radius"/>
|
||||
<label className="hide-1" style={{maxWidth:"75px",'vertical-align':'middle'}}>{text}</label>
|
||||
</Link>
|
||||
</span>
|
||||
|
|
|
@ -212,7 +212,7 @@ class Detail extends Component {
|
|||
>
|
||||
<img
|
||||
className="user_img"
|
||||
src={getImageUrl(`images/${data && data.author_picture}`)}
|
||||
src={getImageUrl(`/${data && data.author_picture}`)}
|
||||
alt=""
|
||||
width="50"
|
||||
height="50"
|
||||
|
|
|
@ -186,7 +186,7 @@ function CollaboratorMember({projectsId,owner,project_id,author,showNotification
|
|||
className="show-user-link"
|
||||
>
|
||||
<img
|
||||
src={getImageUrl(`images/${text}`)}
|
||||
src={getImageUrl(`/${text}`)}
|
||||
alt=""
|
||||
width="32px"
|
||||
height="32px"
|
||||
|
|
|
@ -30,7 +30,7 @@ export default (({projects}) => {
|
|||
projects.map((item, key) => {
|
||||
return (
|
||||
<Div>
|
||||
<Imgs src={item.project && getImageUrl(`images/${item.project.owner_image_url}`)}/>
|
||||
<Imgs src={item.project && getImageUrl(`/${item.project.owner_image_url}`)}/>
|
||||
<Link to={`/projects/${item.project.owner_name}/${item.project.identifier}`}>{item.project.name}</Link>
|
||||
</Div>
|
||||
)
|
||||
|
|
|
@ -76,7 +76,7 @@ export default ((props) => {
|
|||
width: "7%",
|
||||
render: (value, item) => {
|
||||
return (
|
||||
<Img src={getImageUrl(`images/${item.user.image_url}`)}></Img>
|
||||
<Img src={getImageUrl(`/${item.user.image_url}`)}></Img>
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -72,7 +72,7 @@ function RightBox({ OIdentifier , history , admin }) {
|
|||
memberData.organization_users.map((item,key)=>{
|
||||
return(
|
||||
<div className="teammembers" key={key}>
|
||||
<Link to={`/users/${item.user && item.user.login}`}><Img src={getImageUrl(`images/${item.user && item.user.image_url}`)} alt="" className="m-img"/></Link>
|
||||
<Link to={`/users/${item.user && item.user.login}`}><Img src={getImageUrl(`/${item.user && item.user.image_url}`)} alt="" className="m-img"/></Link>
|
||||
<div>
|
||||
<Link to={`/users/${item.user && item.user.login}`}><ListName>{item.user && item.user.name}</ListName></Link>
|
||||
<Align><i className="iconfont icon-shijian color-green mr3 font-13"></i><Span>加入时间:{item.created_at}</Span></Align>
|
||||
|
|
|
@ -169,7 +169,7 @@ export default Form.create()(
|
|||
<Input value="-1" style={{width:"350px"}}/>
|
||||
)}
|
||||
<p>选择头像:</p>
|
||||
<UploadImage url={getImageUrl(`images/${image}`)} getImage={getImage}/>
|
||||
<UploadImage url={getImageUrl(`/${image}`)} getImage={getImage}/>
|
||||
<Button type={"primary"} onClick={updateDetail}>更新仓库设置</Button>
|
||||
</Form>
|
||||
</Div>
|
||||
|
|
|
@ -64,7 +64,7 @@ export default (({organizeDetail})=>{
|
|||
width:"5%",
|
||||
render:(value)=>{
|
||||
return(
|
||||
value && <Link to={`/users/${value && value.login}`}><Img src={getImageUrl('images/'+value.image_url)}></Img> </Link>
|
||||
value && <Link to={`/users/${value && value.login}`}><Img src={getImageUrl('/'+value.image_url)}></Img> </Link>
|
||||
)
|
||||
}
|
||||
},
|
||||
|
|
|
@ -86,7 +86,7 @@ function TeamGroupItems({organizeDetail,limit, count , history}){
|
|||
{
|
||||
item.users && item.users.map((i,k)=>{
|
||||
return(
|
||||
k < count ? <Link to={`/users/${i.login}`}><ImgContent title={i.name} key={k} src={getImageUrl(`images/${i.image_url}`)}/></Link>
|
||||
k < count ? <Link to={`/users/${i.login}`}><ImgContent title={i.name} key={k} src={getImageUrl(`/${i.image_url}`)}/></Link>
|
||||
:
|
||||
k === count ?
|
||||
<Link to={`/organize/${organizeDetail && organizeDetail.name}/group/${item.id}`} className="moreMember" title="查看更多" ><i className="iconfont icon-zhunbeizhong"></i></Link>
|
||||
|
|
|
@ -88,7 +88,7 @@ class ForkUsers extends Component {
|
|||
>
|
||||
<img
|
||||
className="avatar-60"
|
||||
src={getImageUrl(`images/${item.image_url}`)}
|
||||
src={getImageUrl(`/${item.image_url}`)}
|
||||
alt=""
|
||||
/>
|
||||
</Link>
|
||||
|
|
|
@ -18,7 +18,7 @@ class UserList extends Component {
|
|||
>
|
||||
<img
|
||||
className="avatar-60"
|
||||
src={getImageUrl(`images/${item.image_url}`)}
|
||||
src={getImageUrl(`/${item.image_url}`)}
|
||||
alt=""
|
||||
/>
|
||||
</a>
|
||||
|
|
|
@ -118,7 +118,7 @@ class children_comments extends Component {
|
|||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(`images/${item && item.user_picture}`)}
|
||||
src={getImageUrl(`/${item && item.user_picture}`)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"
|
||||
|
|
|
@ -82,7 +82,7 @@ class children_journals extends Component {
|
|||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(`images/${item && item.user_picture}`)}
|
||||
src={getImageUrl(`/${item && item.user_picture}`)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"
|
||||
|
|
|
@ -375,7 +375,7 @@ class comments extends Component {
|
|||
>
|
||||
<img
|
||||
className="radius"
|
||||
src={getImageUrl(`images/${item && item.user_picture}`)}
|
||||
src={getImageUrl(`/${item && item.user_picture}`)}
|
||||
alt=""
|
||||
width="30"
|
||||
height="30"
|
||||
|
@ -471,7 +471,7 @@ class comments extends Component {
|
|||
className="radius"
|
||||
src={
|
||||
current_user && current_user.image_url
|
||||
? getImageUrl(`images/${current_user.image_url}`)
|
||||
? getImageUrl(`/${current_user.image_url}`)
|
||||
: "images/avatars/User/b"
|
||||
}
|
||||
alt=""
|
||||
|
@ -528,7 +528,7 @@ class comments extends Component {
|
|||
className="radius"
|
||||
src={
|
||||
current_user && current_user.image_url
|
||||
? getImageUrl(`images/${current_user.image_url}`)
|
||||
? getImageUrl(`/${current_user.image_url}`)
|
||||
: "images/avatars/User/b"
|
||||
}
|
||||
alt=""
|
||||
|
|
|
@ -150,7 +150,7 @@ class Infos extends Component {
|
|||
<div className="list-l-Menu text-center pd20 ">
|
||||
<Avatar
|
||||
size={110}
|
||||
src={getImageUrl(`images/${user && user.image_url}`)}
|
||||
src={getImageUrl(`/${user && user.image_url}`)}
|
||||
/>
|
||||
{user && user.user_identity && (
|
||||
<div className="mt-n15 position-relative">
|
||||
|
|
|
@ -4,7 +4,7 @@ import { getImageUrl } from 'educoder';
|
|||
function TeamItem({item,history}){
|
||||
return(
|
||||
<div onClick={()=>{history.push(`/organize/${item.name}`)}} style={{cursor:"pointer"}}>
|
||||
<div className="imgBox"><img alt="" src={getImageUrl(`images/${item.avatar_url}`)}/></div>
|
||||
<div className="imgBox"><img alt="" src={getImageUrl(`/${item.avatar_url}`)}/></div>
|
||||
<div style={{flex:'1'}}>
|
||||
<span className="mb5 font-18 color-grey-3 task-hide">{item.name}</span>
|
||||
<div className="task-hide-2">
|
||||
|
|
Loading…
Reference in New Issue