Commit 3e9813e2 authored by Maofei94's avatar Maofei94

perf: 优化相关

parent 2f4d379e
......@@ -145,16 +145,17 @@ export default props => {
init();
}, []);
useEffect(() => {
console.log(window.location.origin);
const hurl = window.location.origin;
getMobileFiles({ client: clientName }).then(res => {
if (res.code === 0) {
const { data } = res;
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({
...data,
fileName,
isRefresh: true,
apkUrl,
});
}
});
......@@ -180,8 +181,8 @@ export default props => {
<div className={styles.row}>
<div className={styles.label}>下载地址:</div>
<div className="value">
<a href="/MobileGCK/getApk" target="_blank">
{`/MobileGCK/getApk`}
<a href={fileData.apkUrl} target="_blank">
{fileData.apkUrl}
</a>
</div>
</div>
......@@ -212,29 +213,27 @@ export default props => {
maskClosable={false}
onCancel={() => setShowModal(false)}
onOk={submitForm}
confirmLoading={progress}
>
<BaseForm items={items} getForm={handleGetForm} />
<div className={styles.row}>
<div className={`${styles.label2} ${styles.required}`}>
apk文件:
</div>
<input
ref={f => {
fileEntity.current = f;
}}
className={styles['file-item']}
type="file"
onChange={handleFileChange}
/>
<Button type="primary" onClick={handleUpload}>
{fileSuccess ? '上传成功' : '开始上传'}
</Button>
</div>
{progress && (
<div className={styles.loadingBox}>
<Spin />
<Spin spinning={progress} tip="loading...">
<BaseForm items={items} getForm={handleGetForm} />
<div className={styles.row}>
<div className={`${styles.label2} ${styles.required}`}>
apk文件:
</div>
<input
ref={f => {
fileEntity.current = f;
}}
className={styles['file-item']}
type="file"
onChange={handleFileChange}
/>
<Button type="primary" onClick={handleUpload}>
{fileSuccess ? '上传成功' : '开始上传'}
</Button>
</div>
)}
</Spin>
</Modal>
)}
</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