dev_forum
hjm 5 years ago
parent 32ea657e61
commit 4abaf0d192

@ -2,7 +2,7 @@ import React, { Component } from "react";
import { Modal } from "antd";
import axios from 'axios'
import ModalWrapper from "../../courses/common/ModalWrapper"
import { Cropper } from 'educoder'
import { Cropper, getUrl } from 'educoder'
const imageId = 'changeHeaderPic'
const previewId = 'changeHeader_imagePreview'
@ -120,7 +120,8 @@ class ChangeHeaderPicModal extends Component{
render(){
const { course_lists } = this.state
const { moduleName } = this.props
const { moduleName, current_user } = this.props
const userHeaderImgUrl = `${getUrl()}/images/${current_user.image_url}`
return(
<ModalWrapper
ref="modalWrapper"
@ -170,6 +171,7 @@ class ChangeHeaderPicModal extends Component{
<div className="cropperWrap">
<Cropper
imageSrc={''}
initPreviewUrl={userHeaderImgUrl}
ref="cropper"
imageId={imageId}
previewId="changeHeader_imagePreview"
@ -181,7 +183,9 @@ class ChangeHeaderPicModal extends Component{
className="df previewWrap" style ={{flexDirection: 'column'}}
>
<div>
<div id="changeHeader_imagePreview"></div>
<div id="changeHeader_imagePreview">
{userHeaderImgUrl && <img src={userHeaderImgUrl}></img>}
</div>
<div className="tip">头像预览</div>
</div>
<label id="uploadBtn" for="inputImage">

Loading…
Cancel
Save