|
|
@@ -23,10 +23,10 @@ const AvatarView = ({ avatar, url, uploadProp }) => ( |
|
|
|
</> |
|
|
|
); |
|
|
|
|
|
|
|
const EnterpriseLog = () => { |
|
|
|
const { data: CompanyInfo, loading } = useRequest(() => { |
|
|
|
return GetCompanyInfo(); |
|
|
|
}); |
|
|
|
const EnterpriseLog = (props) => { |
|
|
|
// const { data: CompanyInfo, loading } = useRequest(() => { |
|
|
|
// return GetCompanyInfo(); |
|
|
|
// }); |
|
|
|
const [url, setUrl] = useState(); |
|
|
|
const [cosInfo, SetCosInfo] = useState({ |
|
|
|
domain: '', |
|
|
@@ -77,11 +77,15 @@ const EnterpriseLog = () => { |
|
|
|
onProgress({ percent: Math.round(loaded / total * 100).toFixed(2) }, file); |
|
|
|
}, |
|
|
|
}).then(response => { |
|
|
|
console.log('onSuccess', response, file); |
|
|
|
// console.log('onSuccess', response, file); |
|
|
|
if (response.status == 200 || response.statusText == 'OK') { |
|
|
|
setUrl(r.seeUrl); |
|
|
|
CompanyInfo.logo = r.seeUrl; |
|
|
|
updateCompany(CompanyInfo); |
|
|
|
// setUrl(r.seeUrl); |
|
|
|
const company = JSON.parse(JSON.stringify(props.fetchCompanyInfo)); |
|
|
|
company.logo = r.seeUrl; |
|
|
|
// console.log('LOGO变更', company.logo) |
|
|
|
props.onUpdateCompanyInfo(company); |
|
|
|
// CompanyInfo.logo = r.seeUrl; |
|
|
|
// updateCompany(CompanyInfo); |
|
|
|
} |
|
|
|
// onSuccess(response, file); |
|
|
|
}) |
|
|
@@ -99,16 +103,12 @@ const EnterpriseLog = () => { |
|
|
|
}; |
|
|
|
return ( |
|
|
|
<div className={styles.baseView}> |
|
|
|
{loading ? null : ( |
|
|
|
<> |
|
|
|
<div className={styles.right}> |
|
|
|
<AvatarView |
|
|
|
url={CompanyInfo.logo ? CompanyInfo.logo:'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png' } |
|
|
|
uploadProp={uploadProps} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</> |
|
|
|
)} |
|
|
|
<div className={styles.right}> |
|
|
|
<AvatarView |
|
|
|
url={props.fetchCompanyInfo.logo ? props.fetchCompanyInfo.logo : 'https://gw.alipayobjects.com/zos/rmsportal/BiazfanxmamNRoxxVxka.png'} |
|
|
|
uploadProp={uploadProps} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
); |
|
|
|
}; |
|
|
|