From 19db3bbe17de695c5ad0468bd07ce8a0721f2de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 13 Jul 2019 16:59:29 +0800 Subject: [PATCH] b --- .../PackageIndexNEIBannerConcent.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js index 13850e77..07df9c1c 100644 --- a/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js +++ b/public/react/src/modules/projectPackages/PackageIndexNewandEdit/PackageIndexNEIBannerConcent.js @@ -66,6 +66,13 @@ class PackageIndexNEIBannerConcent extends Component { categories:[] } } + componentDidUpdate = (prevProps) => { + if(prevProps.current_user.username!=this.props.current_user.username){ + this.setState({ + contact_name:this.props.current_user.username + }) + } + } componentDidMount() { @@ -82,7 +89,7 @@ class PackageIndexNEIBannerConcent extends Component { deadline_at:moment(data.deadline_at), min_price:data.min_price, max_price:data.max_price, - contact_name:data.contact_name==null?this.props.current_user.username:data.contact_name, + contact_name:data.contact_name==null||data.contact_name==undefined?this.props.current_user.username:data.contact_name, phones:data.contact_phone, attachments:data.attachments,