From a107be221c2a8f3135e60060ebff32ee693f1d1e Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Thu, 25 Jul 2019 14:02:02 +0800 Subject: [PATCH] delay 1 --- public/react/src/common/components/Cropper.js | 2 +- .../src/modules/courses/busyWork/UseBank.js | 2 +- .../user/account/ChangeHeaderPicModal.js | 21 ++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/public/react/src/common/components/Cropper.js b/public/react/src/common/components/Cropper.js index 632950434..3ce30a8b5 100644 --- a/public/react/src/common/components/Cropper.js +++ b/public/react/src/common/components/Cropper.js @@ -102,7 +102,7 @@ class Cropper extends Component { setTimeout(() => { const image = document.getElementById(this.props.imageId || '__image'); this.cropper = new window.Cropper(image, this.options); - }, 1000) + }, 1200) } renew = (image) => { diff --git a/public/react/src/modules/courses/busyWork/UseBank.js b/public/react/src/modules/courses/busyWork/UseBank.js index 671a09fff..ca65e74be 100644 --- a/public/react/src/modules/courses/busyWork/UseBank.js +++ b/public/react/src/modules/courses/busyWork/UseBank.js @@ -194,7 +194,7 @@ class UseBank extends Component{ display: -webkit-flex; } .setImgW .edu-nodata-img{ - width:218px !important; + width: 170px !important; } .bankwidth{ width:24% !important; diff --git a/public/react/src/modules/user/account/ChangeHeaderPicModal.js b/public/react/src/modules/user/account/ChangeHeaderPicModal.js index abb3d0e12..cef643094 100644 --- a/public/react/src/modules/user/account/ChangeHeaderPicModal.js +++ b/public/react/src/modules/user/account/ChangeHeaderPicModal.js @@ -105,11 +105,16 @@ class ChangeHeaderPicModal extends Component{ .then((response) => { // {"status":0,"message":"success","avatar_url":"avatars/User/15739"} if (response.data.status == 0) { - // this.props.getBasicInfo() - this.props.fetchUser() - // 头像更新后会触发AccountPage的DidUpdate,然后会调用getBasicInfo - this.props.showNotification && this.props.showNotification("修改头像成功") - this.setVisible(false) + // this.props.getBasicInfo() + // https://www.trustie.net/issues/22461 + if ( this.props.current_user.image_url.indexOf('avatars/User/b') != -1 + || this.props.current_user.image_url.indexOf('avatars/User/g') != -1 ) { + this.setTimeout(() => { + this.doAfterUpdated() + }, 1000) + } else { + this.doAfterUpdated(); + } } }) .catch(function (error) { @@ -117,6 +122,12 @@ class ChangeHeaderPicModal extends Component{ }); }); } + doAfterUpdated = () => { + this.props.fetchUser() + // 头像更新后会触发AccountPage的DidUpdate,然后会调用getBasicInfo + this.props.showNotification && this.props.showNotification("修改头像成功") + this.setVisible(false) + } render(){ const { course_lists } = this.state