修复getimageurl

This commit is contained in:
qyzh 2021-12-22 11:10:09 +08:00
parent 600227600a
commit e2754498af
4 changed files with 54 additions and 27 deletions

Binary file not shown.

View File

@ -11,7 +11,8 @@ export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net
// const local = 'http://localhost:3000'
const local = 'https://testforgeplus.trustie.net';
// const local = 'https://testforgeplus.trustie.net';
const local = 'http://114.212.189.230:3000'
if (isDev) {
return `${local}/${path}`
}

View File

@ -265,7 +265,7 @@ class Sponsor extends Component {
const sponsorList = (sponsors && sponsors.length>0 ? sponsors.map((item, key)=>{
return (
<Link to={`/users/${item.login}`} className="show-user-link">
<img className="sponsor-page-sponsors" alt="" src={getImageUrl(`images/${item && item.image_url}`)} title={item.username}></img>
<img className="sponsor-page-sponsors" alt="" src={getImageUrl(`/${item && item.image_url}`)} title={item.username}></img>
</Link>);
})
:"")
@ -296,15 +296,22 @@ class Sponsor extends Component {
<div className="sponsor-page-left">
<div className="list-l-Menu pd20 ">
<div className="text-center mt15 font-16 fwb"> 成为{user && user.username}的赞助者吧</div>
<div className="text-center"><Avatar
<div className="text-center">
<span className="headimg">
<img src={getImageUrl(`/${user && user.image_url}`)} alt=""/>
<span>
{
user && user.gender===1?
<i className="iconfont icon-nan1"></i>
:
<i className="iconfont icon-nv1"></i>
}
</span>
</span>
{/* <Avatar
size={110}
src={getImageUrl(`images/${user && user.image_url}`)}
/>
{user && user.user_identity && (
<div className="mt-n15 position-relative">
<Tag color="#FF6E21" style={{marginRight:"0px"}}>{user && user.user_identity}</Tag>
</div>
)}
/> */}
</div>
<Divider />
{content}
@ -341,10 +348,13 @@ class Sponsor extends Component {
}
// export default withRouter(
// ImageLayerOfCommentHOC({
// // imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
// // parentSelector: ".newMain",
// })(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Sponsor))))
// );
export default withRouter(
ImageLayerOfCommentHOC({
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
parentSelector: ".newMain",
})(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Sponsor))))
);
(CNotificationHOC()(SnackbarHOC()(TPMIndexHOC(Sponsor))))
);

View File

@ -273,7 +273,8 @@ class LoginRegisterComponent extends Component {
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(this.state.logins)) {
// if (!regph.test(this.state.logins)) {
if (true) {
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotcos: undefined,
@ -292,12 +293,14 @@ class LoginRegisterComponent extends Component {
}
if (!regemail.test(this.state.logins)) {
if ((this.state.logins.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
// if ((this.state.logins.indexOf("@") != -1) === true) {
// stringdata = "邮箱格式不正确";
// } else {
// stringdata = "手机号格式不正确";
}
// }
stringdata = "邮箱格式不正确";
this.setState({
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: true,
@ -501,6 +504,17 @@ class LoginRegisterComponent extends Component {
return;
}
/*
校验
*/
var loginReg = /[a-zA-Z]+[\w]*/;
if (!loginReg.test(this.state.codes)){
this.setState({
Phonenumberisnotcosyzm: "必须是字母开头的字母数字组合",
})
return ;
}
let url;
if(this.props.weixinlogin){
url= '/weapps/register.json';
@ -769,7 +783,8 @@ class LoginRegisterComponent extends Component {
// [1]手机号开头必须是1 [3,4,5,6,7,8] 第二位是3-8中的一个 [0-9]{9} 后边9位可以是0-9的任意数字。
var stringdata = undefined;
if (!regph.test(e.target.value)) {
// if (!regph.test(e.target.value)) {
if(true){
stringdata = "手机号格式不正确";
this.setState({
Phonenumberisnotcos: stringdata,
@ -787,12 +802,13 @@ class LoginRegisterComponent extends Component {
}
if (!regemail.test(e.target.value)) {
if ((e.target.value.indexOf("@") != -1) === true) {
stringdata = "邮箱格式不正确";
} else {
stringdata = "手机号格式不正确";
// if ((e.target.value.indexOf("@") != -1) === true) {
// stringdata = "邮箱格式不正确";
// } else {
// stringdata = "手机号格式不正确";
}
// }
stringdata = "邮箱格式不正确";
this.setState({
Phonenumberisnotcos: stringdata,
Phonenumberisnotcobool: true,
@ -1119,7 +1135,7 @@ class LoginRegisterComponent extends Component {
{
weixinlogin===false&&parseInt(tab[0])==1 &&
<div style={{width: '340px'}}>
<Input placeholder="请使用手机号/邮箱账号进行注册"
<Input placeholder="邮箱账号进行注册"
className={Phonenumberisnotcos && Phonenumberisnotcos !== "" ?" color-grey-9 loginInputzhucheyslass bor-reds":" color-grey-9 loginInputzhuche"}
value={this.state.logins}
type="text" autoComplete="off"