dev_forum
hjm 5 years ago
parent 46da6fa553
commit 535e47d06d

@ -1,12 +1,16 @@
import React, { Component } from 'react';
import { SnackbarHOC, getImageUrl } from 'educoder';
import ChangeHeaderPicModal from './ChangeHeaderPicModal'
class AccountNav extends Component {
editImg = () => {
this.refs['picModal'].setVisible(true)
}
render() {
// newMain clearfix
return (
<div className="headphoto mt14">
<ChangeHeaderPicModal {...this.props} ref="picModal"></ChangeHeaderPicModal>
<style>{`
/*
.headphoto {

@ -41,8 +41,9 @@ class ChangeHeaderPicModal extends Component{
// cropper = new Cropper(image, options);
inputImage.value = null;
} else {
// TODO noti
window.alert('Please choose an image file.');
this.props.showNotification && this.props.showNotification("请选择一个图片格式的文件")
// window.alert('Please choose an image file.');
}
}
};
@ -78,7 +79,9 @@ class ChangeHeaderPicModal extends Component{
.then((response) => {
// {"status":0,"message":"success","avatar_url":"avatars/User/15739"}
if (response.data.status == 0) {
// TODO noti
this.props.showNotification && this.props.showNotification("修改头像成功")
this.setVisible(false)
}
})
.catch(function (error) {

Loading…
Cancel
Save