Commit 3e9813e2 authored by Maofei94's avatar Maofei94

perf: 优化相关

parent 2f4d379e
...@@ -145,16 +145,17 @@ export default props => { ...@@ -145,16 +145,17 @@ export default props => {
init(); init();
}, []); }, []);
useEffect(() => { useEffect(() => {
console.log(window.location.origin); const hurl = window.location.origin;
getMobileFiles({ client: clientName }).then(res => { getMobileFiles({ client: clientName }).then(res => {
if (res.code === 0) { if (res.code === 0) {
const { data } = res; const { data } = res;
let fileName = let fileName =
data.apkPath.split('/')[data.apkPath.split('/').length - 1] || ''; data.apkPath.split('\\')[data.apkPath.split('\\').length - 1] || '';
let apkUrl = `${hurl}/${data.apkPath.replace(/\\/g, '/')}` || '';
setFileData({ setFileData({
...data, ...data,
fileName, fileName,
isRefresh: true, apkUrl,
}); });
} }
}); });
...@@ -180,8 +181,8 @@ export default props => { ...@@ -180,8 +181,8 @@ export default props => {
<div className={styles.row}> <div className={styles.row}>
<div className={styles.label}>下载地址:</div> <div className={styles.label}>下载地址:</div>
<div className="value"> <div className="value">
<a href="/MobileGCK/getApk" target="_blank"> <a href={fileData.apkUrl} target="_blank">
{`/MobileGCK/getApk`} {fileData.apkUrl}
</a> </a>
</div> </div>
</div> </div>
...@@ -212,7 +213,9 @@ export default props => { ...@@ -212,7 +213,9 @@ export default props => {
maskClosable={false} maskClosable={false}
onCancel={() => setShowModal(false)} onCancel={() => setShowModal(false)}
onOk={submitForm} onOk={submitForm}
confirmLoading={progress}
> >
<Spin spinning={progress} tip="loading...">
<BaseForm items={items} getForm={handleGetForm} /> <BaseForm items={items} getForm={handleGetForm} />
<div className={styles.row}> <div className={styles.row}>
<div className={`${styles.label2} ${styles.required}`}> <div className={`${styles.label2} ${styles.required}`}>
...@@ -230,11 +233,7 @@ export default props => { ...@@ -230,11 +233,7 @@ export default props => {
{fileSuccess ? '上传成功' : '开始上传'} {fileSuccess ? '上传成功' : '开始上传'}
</Button> </Button>
</div> </div>
{progress && ( </Spin>
<div className={styles.loadingBox}>
<Spin />
</div>
)}
</Modal> </Modal>
)} )}
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment