|
|
@@ -40,13 +40,21 @@
|
|
|
/>
|
|
|
|
|
|
<el-button class="download-button" type="primary" size="large" :disabled="downloading" @click="download">
|
|
|
- {{ downloading ? '正在跳转…' : '下载 Android 安装包' }}
|
|
|
+ {{ downloading ? '下载任务已提交' : '下载 Android 安装包' }}
|
|
|
</el-button>
|
|
|
+ <el-alert
|
|
|
+ v-if="downloading"
|
|
|
+ class="download-hint"
|
|
|
+ title="请查看浏览器下载列表;下载页面会继续保留,无需返回空白页。"
|
|
|
+ type="success"
|
|
|
+ :closable="false"
|
|
|
+ show-icon
|
|
|
+ />
|
|
|
|
|
|
<div class="security">
|
|
|
<p>SHA-256</p>
|
|
|
<code>{{ release.sha256 }}</code>
|
|
|
- <p>下载票据仅可使用一次;如下载中断,请在 PC 端重新生成。</p>
|
|
|
+ <p>二维码票据仅消费一次;下载开始后支持短时间内重试和断点续传。</p>
|
|
|
</div>
|
|
|
</template>
|
|
|
</main>
|
|
|
@@ -57,6 +65,7 @@
|
|
|
import { computed, onMounted, ref } from 'vue';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import { buildAppDownloadUrl, getAppTicketInfo, type AppReleaseInfo } from './api';
|
|
|
+import { formatAppServerDate, startBrowserDownload } from './downloadUi';
|
|
|
|
|
|
const route = useRoute();
|
|
|
const loading = ref(true);
|
|
|
@@ -84,7 +93,8 @@ onMounted(async () => {
|
|
|
function download() {
|
|
|
if (!ticket.value || downloading.value) return;
|
|
|
downloading.value = true;
|
|
|
- window.location.assign(buildAppDownloadUrl(ticket.value));
|
|
|
+ const versionName = release.value?.versionName || 'release';
|
|
|
+ startBrowserDownload(buildAppDownloadUrl(ticket.value), `MDIOP-${versionName}.apk`);
|
|
|
}
|
|
|
|
|
|
function formatSize(bytes?: number) {
|
|
|
@@ -93,9 +103,7 @@ function formatSize(bytes?: number) {
|
|
|
}
|
|
|
|
|
|
function formatDate(value?: string) {
|
|
|
- if (!value) return '-';
|
|
|
- const date = new Date(value);
|
|
|
- return Number.isNaN(date.getTime()) ? value : date.toLocaleString('zh-CN', { hour12: false });
|
|
|
+ return formatAppServerDate(value);
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
@@ -163,6 +171,11 @@ h1 {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
+.download-hint {
|
|
|
+ margin-top: 12px;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+
|
|
|
.security {
|
|
|
margin-top: 20px;
|
|
|
color: #909399;
|