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,29 +213,27 @@ export default props => { ...@@ -212,29 +213,27 @@ export default props => {
maskClosable={false} maskClosable={false}
onCancel={() => setShowModal(false)} onCancel={() => setShowModal(false)}
onOk={submitForm} onOk={submitForm}
confirmLoading={progress}
> >
<BaseForm items={items} getForm={handleGetForm} /> <Spin spinning={progress} tip="loading...">
<div className={styles.row}> <BaseForm items={items} getForm={handleGetForm} />
<div className={`${styles.label2} ${styles.required}`}> <div className={styles.row}>
apk文件: <div className={`${styles.label2} ${styles.required}`}>
</div> apk文件:
<input </div>
ref={f => { <input
fileEntity.current = f; ref={f => {
}} fileEntity.current = f;
className={styles['file-item']} }}
type="file" className={styles['file-item']}
onChange={handleFileChange} type="file"
/> onChange={handleFileChange}
<Button type="primary" onClick={handleUpload}> />
{fileSuccess ? '上传成功' : '开始上传'} <Button type="primary" onClick={handleUpload}>
</Button> {fileSuccess ? '上传成功' : '开始上传'}
</div> </Button>
{progress && (
<div className={styles.loadingBox}>
<Spin />
</div> </div>
)} </Spin>
</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