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'
|
const isdev2= window.location.hostname ==='www.educoder.net'
|
||||||
export const TEST_HOST = "https://testforgeplus.trustie.net/"
|
export const TEST_HOST = "https://testforgeplus.trustie.net/"
|
||||||
export function getImageUrl(path) {
|
export function getImageUrl(path) {
|
||||||
// https://www.educoder.net
|
const reg = /(http|https):\/\/([\w.]+\/?)\S*/;
|
||||||
// https://testbdweb.trustie.net
|
if(reg.test(path)){
|
||||||
// const local = 'http://localhost:3000'
|
return path;
|
||||||
|
}
|
||||||
const local = 'https://testforgeplus.trustie.net'
|
const local = 'https://testforgeplus.trustie.net'
|
||||||
if (isDev) {
|
if (isDev) {
|
||||||
return `${local}/${path}`
|
return `${local}/${path}`
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React , { useState, useEffect } from 'react';
|
import React , { useState, useEffect } from 'react';
|
||||||
import { WhiteBack , Greenline , UDStructure , Grid } from '../css/layout';
|
import { WhiteBack , Greenline , UDStructure , Grid } from '../css/layout';
|
||||||
import UserInfo from './UserInfo';
|
import UserInfo from './UserInfo';
|
||||||
import { getUrl } from "educoder";
|
import { getImageUrl } from "educoder";
|
||||||
import StarUser from "../../user_info/User/StarUser";
|
import StarUser from "../../user_info/User/StarUser";
|
||||||
export default (({user})=>{
|
export default (({user})=>{
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -17,7 +17,7 @@ export default (({user})=>{
|
||||||
|
|
||||||
return(
|
return(
|
||||||
<WhiteBack className="authorCard">
|
<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>
|
<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 && (
|
{/* {user && !user.is_current_user && (
|
||||||
<StarUser
|
<StarUser
|
||||||
|
|
|
@ -2,7 +2,7 @@ import React, { useState } from "react";
|
||||||
import { WhiteBack } from "../css/layout";
|
import { WhiteBack } from "../css/layout";
|
||||||
import Title from './Title';
|
import Title from './Title';
|
||||||
import UserInfo from "./UserInfo";
|
import UserInfo from "./UserInfo";
|
||||||
import { getUrl } from 'educoder';
|
import { getImageUrl } from 'educoder';
|
||||||
export default (({ author }) => {
|
export default (({ author }) => {
|
||||||
return (
|
return (
|
||||||
<WhiteBack>
|
<WhiteBack>
|
||||||
|
@ -12,7 +12,7 @@ export default (({ author }) => {
|
||||||
author && author.length > 0 ?
|
author && author.length > 0 ?
|
||||||
author.map((item,key)=>{
|
author.map((item,key)=>{
|
||||||
return(
|
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 React, { useState, useEffect } from "react";
|
||||||
import { FlexAJ, AlignCenter, LeftLine } from "../css/layout";
|
import { FlexAJ, AlignCenter, LeftLine } from "../css/layout";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { getUrl } from 'educoder';
|
import { getImageUrl } from 'educoder';
|
||||||
import { Type, Tag } from "./ItemType";
|
import { Type, Tag } from "./ItemType";
|
||||||
import User from "./User";
|
import User from "./User";
|
||||||
import Drop from "./ItemDropDown";
|
import Drop from "./ItemDropDown";
|
||||||
|
@ -59,7 +59,7 @@ export default ({ memos , current_user , calbackFunc , confirm }) => {
|
||||||
</FlexAJ>
|
</FlexAJ>
|
||||||
<FlexAJ className="mt8">
|
<FlexAJ className="mt8">
|
||||||
<AlignCenter>
|
<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.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> : "" }
|
{item.published_time ? <LeftLine>{item.published_time}</LeftLine> : "" }
|
||||||
</AlignCenter>
|
</AlignCenter>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { getUrl } from "educoder";
|
import { getImageUrl } from "educoder";
|
||||||
import { Breadcrumb, Spin, Empty } from "antd";
|
import { Breadcrumb, Spin, Empty } from "antd";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
|
@ -142,7 +142,7 @@ function memo_show(props) {
|
||||||
</Title>
|
</Title>
|
||||||
<AlignCenter className="font-12 pt15 pb15">
|
<AlignCenter className="font-12 pt15 pb15">
|
||||||
<UserInfo
|
<UserInfo
|
||||||
url={getUrl(memoUser.image_url)}
|
url={getImageUrl(memoUser.image_url)}
|
||||||
name={memoUser.username}
|
name={memoUser.username}
|
||||||
login={memoUser.login}
|
login={memoUser.login}
|
||||||
/>
|
/>
|
||||||
|
|
|
@ -3,7 +3,7 @@ import RenderHtml from "../../components/render-html";
|
||||||
import { Popconfirm, Button, message } from "antd";
|
import { Popconfirm, Button, message } from "antd";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import NewComment from "./new_comment";
|
import NewComment from "./new_comment";
|
||||||
import { getUrl } from "educoder";
|
import { getImageUrl } from "educoder";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import ChildrenJournals from "./children_journals";
|
import ChildrenJournals from "./children_journals";
|
||||||
function comment_list({
|
function comment_list({
|
||||||
|
@ -141,7 +141,7 @@ function comment_list({
|
||||||
to={`/accounts/${item && item.user_login}`}
|
to={`/accounts/${item && item.user_login}`}
|
||||||
className="show-user-link"
|
className="show-user-link"
|
||||||
>
|
>
|
||||||
<img className="user-image" src={getUrl(item.image_url)} />
|
<img className="user-image" src={getImageUrl(item.image_url)} />
|
||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
to={`/accounts/${item && item.user_login}`}
|
to={`/accounts/${item && item.user_login}`}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Button } from "antd";
|
import { Button } from "antd";
|
||||||
import { getUrl } from "educoder";
|
import { getImageUrl } from "educoder";
|
||||||
function reply_click({ user_image, click_button }) {
|
function reply_click({ user_image, click_button }) {
|
||||||
const click_reply_to = () =>{
|
const click_reply_to = () =>{
|
||||||
click_button(true)
|
click_button(true)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<div className="new-comment-head grid-item pd20">
|
<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">
|
<span className="reply-comment-input mr20">
|
||||||
<Button className="add_reply_button ml10" onClick={click_reply_to}>
|
<Button className="add_reply_button ml10" onClick={click_reply_to}>
|
||||||
<span>添加评论...</span>
|
<span>添加评论...</span>
|
||||||
|
|
|
@ -764,7 +764,7 @@ class NewHeader extends Component {
|
||||||
:
|
:
|
||||||
<Dropdown placement={`bottomRight`} overlayClassName="imgDropdown" overlay={this.renderMenu(mygetHelmetapi2 && mygetHelmetapi2.personal)}>
|
<Dropdown placement={`bottomRight`} overlayClassName="imgDropdown" overlay={this.renderMenu(mygetHelmetapi2 && mygetHelmetapi2.personal)}>
|
||||||
<a href={fobject && fobject.url}>
|
<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>
|
</a>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue