Merge branch 'newVersion_forge' into dev_devOps

This commit is contained in:
caishi 2020-10-22 18:20:54 +08:00
commit 8d3c5c4c06
3 changed files with 26 additions and 7 deletions

View File

@ -11,11 +11,30 @@ export function getImageUrl(path) {
// https://www.educoder.net // https://www.educoder.net
// https://testbdweb.trustie.net // https://testbdweb.trustie.net
// const local = 'http://localhost:3000' // const local = 'http://localhost:3000'
const local = 'https://testforgeplus.trustie.net/' const local = 'https://testforgeplus.trustie.net/';
if(path.indexOf("http://")===-1){
if (isDev) { if (isDev) {
return `${local}/${path}` return `${local}/${path}`
} }
return `/${path}`; return `/${path}`;
}else{
return path;
}
}
export function getImage(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://testforgeplus.trustie.net/';
if(path.indexOf("http://")===-1){
if (isDev) {
return `${local}/images/${path}`
}
return `/${path}`;
}else{
return path;
}
} }
export function getcdnImageUrl(path) { export function getcdnImageUrl(path) {

View File

@ -4,7 +4,7 @@
export { export {
getUploadLogoActionUrl as getUploadLogoActionUrl, getUploadLogoActionUrl as getUploadLogoActionUrl,
getImageUrl as getImageUrl, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl getImageUrl as getImageUrl,getImage as getImage, getmyUrl as getmyUrl, getRandomNumber as getRandomNumber, getUrl as getUrl, publicSearchs as publicSearchs, getRandomcode as getRandomcode, getUrlmys as getUrlmys, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth , getUploadActionUrl as getUploadActionUrl, getUploadActionUrltwo as getUploadActionUrltwo, getUploadActionUrlthree as getUploadActionUrlthree, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl , getTaskUrlById as getTaskUrlById, TEST_HOST, htmlEncode as htmlEncode, getupload_git_file as getupload_git_file, getcdnImageUrl as getcdnImageUrl
} from './UrlTool'; } from './UrlTool';

View File

@ -1,6 +1,6 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Tooltip } from 'antd'; import { Tooltip } from 'antd';
import { getImageUrl } from 'educoder'; import { getImageUrl , getImage } from 'educoder';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import '../css/index.scss'; import '../css/index.scss';
import Nodata from '../Nodata'; import Nodata from '../Nodata';
@ -21,7 +21,7 @@ class IndexItem extends Component {
return ( return (
<div className="p-r-Item" key={key}> <div className="p-r-Item" key={key}>
<Link to={`/users/${item.author.login}`} className="show-user-link"> <Link to={`/users/${item.author.login}`} className="show-user-link">
<img className="p-r-photo" alt="" src={getImageUrl(`images/${item.author && item.author.image_url}`)} ></img> <img className="p-r-photo" alt="" src={getImage(`${item.author && item.author.image_url}`)} ></img>
</Link> </Link>
<div className="p-r-Infos"> <div className="p-r-Infos">
<div className="p-r-name"> <div className="p-r-name">