forked from Gitlink/forgeplus-react
头像url
This commit is contained in:
parent
ae1f4246e4
commit
b56f0b27c2
File diff suppressed because it is too large
Load Diff
|
@ -8,9 +8,10 @@ const isDev = window.location.port == 3007;
|
|||
const isdev2= window.location.hostname ==='www.educoder.net'
|
||||
export const TEST_HOST = "https://testforgeplus.trustie.net/"
|
||||
export function getImageUrl(path) {
|
||||
// https://www.educoder.net
|
||||
// https://testbdweb.trustie.net
|
||||
// const local = 'http://localhost:3000'
|
||||
const reg = /(http|https):\/\/([\w.]+\/?)\S*/;
|
||||
if(reg.test(path)){
|
||||
return path;
|
||||
}
|
||||
const local = 'https://testforgeplus.trustie.net'
|
||||
if (isDev) {
|
||||
return `${local}/${path}`
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React , { useState, useEffect } from 'react';
|
||||
import { WhiteBack , Greenline , UDStructure , Grid } from '../css/layout';
|
||||
import UserInfo from './UserInfo';
|
||||
import { getUrl } from "educoder";
|
||||
import { getImageUrl } from "educoder";
|
||||
import StarUser from "../../user_info/User/StarUser";
|
||||
export default (({user})=>{
|
||||
useEffect(() => {
|
||||
|
@ -17,7 +17,7 @@ export default (({user})=>{
|
|||
|
||||
return(
|
||||
<WhiteBack className="authorCard">
|
||||
<UserInfo url={getUrl(user && user.image_url)} name={user && user.username} login={user && user.login} column/>
|
||||
<UserInfo url={getImageUrl(user && user.image_url)} name={user && user.username} login={user && user.login} column/>
|
||||
<p style={{width:"100%"}} className="task-hide grey-8 mt10 mb15 edu-text-center">{user && user.description ? user.description : "这家伙太懒了,还未填写个人描述!"}</p>
|
||||
{/* {user && !user.is_current_user && (
|
||||
<StarUser
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { useState } from "react";
|
|||
import { WhiteBack } from "../css/layout";
|
||||
import Title from './Title';
|
||||
import UserInfo from "./UserInfo";
|
||||
import { getUrl } from 'educoder';
|
||||
import { getImageUrl } from 'educoder';
|
||||
export default (({ author }) => {
|
||||
return (
|
||||
<WhiteBack>
|
||||
|
@ -12,7 +12,7 @@ export default (({ author }) => {
|
|||
author && author.length > 0 ?
|
||||
author.map((item,key)=>{
|
||||
return(
|
||||
<UserInfo login={item.login} url={getUrl(`/images/${item.image_url}`)} name={item.username} column/>
|
||||
<UserInfo login={item.login} url={getImageUrl(`${item.image_url}`)} name={item.username} column/>
|
||||
)
|
||||
})
|
||||
:""
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useState, useEffect } from "react";
|
||||
import { FlexAJ, AlignCenter, LeftLine } from "../css/layout";
|
||||
import { Link } from "react-router-dom";
|
||||
import { getUrl } from 'educoder';
|
||||
import { getImageUrl } from 'educoder';
|
||||
import { Type, Tag } from "./ItemType";
|
||||
import User from "./User";
|
||||
import Drop from "./ItemDropDown";
|
||||
|
@ -59,7 +59,7 @@ export default ({ memos , current_user , calbackFunc , confirm }) => {
|
|||
</FlexAJ>
|
||||
<FlexAJ className="mt8">
|
||||
<AlignCenter>
|
||||
<User login={item.user_login} name={item.username} url={getUrl("/images/"+item.image_url)}></User>
|
||||
<User login={item.user_login} name={item.username} url={getImageUrl(item.image_url)}></User>
|
||||
{item.forum_section_title ? <Link to={`/forums/theme/${item.forum_section_id}`}><LeftLine>{item.forum_section_title}</LeftLine></Link> : "" }
|
||||
{item.published_time ? <LeftLine>{item.published_time}</LeftLine> : "" }
|
||||
</AlignCenter>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
import axios from "axios";
|
||||
import { getUrl } from "educoder";
|
||||
import { getImageUrl } from "educoder";
|
||||
import { Breadcrumb, Spin, Empty } from "antd";
|
||||
import { Link } from "react-router-dom";
|
||||
import {
|
||||
|
@ -142,7 +142,7 @@ function memo_show(props) {
|
|||
</Title>
|
||||
<AlignCenter className="font-12 pt15 pb15">
|
||||
<UserInfo
|
||||
url={getUrl(memoUser.image_url)}
|
||||
url={getImageUrl(memoUser.image_url)}
|
||||
name={memoUser.username}
|
||||
login={memoUser.login}
|
||||
/>
|
||||
|
|
|
@ -3,7 +3,7 @@ import RenderHtml from "../../components/render-html";
|
|||
import { Popconfirm, Button, message } from "antd";
|
||||
import { Link } from "react-router-dom";
|
||||
import NewComment from "./new_comment";
|
||||
import { getUrl } from "educoder";
|
||||
import { getImageUrl } from "educoder";
|
||||
import axios from "axios";
|
||||
import ChildrenJournals from "./children_journals";
|
||||
function comment_list({
|
||||
|
@ -141,7 +141,7 @@ function comment_list({
|
|||
to={`/accounts/${item && item.user_login}`}
|
||||
className="show-user-link"
|
||||
>
|
||||
<img className="user-image" src={getUrl(item.image_url)} />
|
||||
<img className="user-image" src={getImageUrl(item.image_url)} />
|
||||
</Link>
|
||||
<Link
|
||||
to={`/accounts/${item && item.user_login}`}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import React from "react";
|
||||
import { Button } from "antd";
|
||||
import { getUrl } from "educoder";
|
||||
import { getImageUrl } from "educoder";
|
||||
function reply_click({ user_image, click_button }) {
|
||||
const click_reply_to = () =>{
|
||||
click_button(true)
|
||||
}
|
||||
return (
|
||||
<div className="new-comment-head grid-item pd20">
|
||||
<img src={getUrl(user_image)} className="user-image"></img>
|
||||
<img src={getImageUrl(user_image)} className="user-image"></img>
|
||||
<span className="reply-comment-input mr20">
|
||||
<Button className="add_reply_button ml10" onClick={click_reply_to}>
|
||||
<span>添加评论...</span>
|
||||
|
|
|
@ -764,7 +764,7 @@ class NewHeader extends Component {
|
|||
:
|
||||
<Dropdown placement={`bottomRight`} overlayClassName="imgDropdown" overlay={this.renderMenu(mygetHelmetapi2 && mygetHelmetapi2.personal)}>
|
||||
<a href={fobject && fobject.url}>
|
||||
<img alt="头像" width="34px" src={getImageUrl(`images/` + user.image_url)} className="radius ml30"></img>
|
||||
<img alt="头像" width="34px" src={getImageUrl(user.image_url)} className="radius ml30" />
|
||||
</a>
|
||||
</Dropdown>
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue