diff --git a/assets/js/cms-download.js b/assets/js/cms-download.js
index 83995302..148d7526 100644
--- a/assets/js/cms-download.js
+++ b/assets/js/cms-download.js
@@ -252,10 +252,6 @@
}
// ===== 成功渲染 =====
- function metaChip(icon, label) {
- return '' + escapeHtml(label) + '';
- }
-
function renderSuccess(payload, returnFocusEl) {
payload = payload || {};
const code = String(payload.extract_code || '').trim();
@@ -266,6 +262,8 @@
? Math.max(1, Math.round(payload.expires_in / 60))
: 10;
+ const hintMsg = '点击下方按钮开始下载,链接 ' + expiresIn + ' 分钟内有效。';
+
let body = '';
if (code !== '') {
body +=
@@ -275,11 +273,12 @@
' ' + safeCode + '' +
' ' +
' ' +
- '';
+ '' +
+ '
' + escapeHtml(hintMsg) + '
'; } else if (has) { body += '下载源标记了提取码,但接口未返回具体内容,请检查资源下载源的 extract_code 字段。
'; } else { - body += '点击下方按钮开始下载,文件请及时保存到本地。
'; + body += '' + escapeHtml(hintMsg) + '
'; } const chips = []; @@ -287,11 +286,9 @@ if (sourceLabel !== '') { chips.push('' + escapeHtml(sourceLabel) + ''); } - chips.push(metaChip('fa-clock', '链接 ' + expiresIn + ' 分钟内有效')); - if (typeof payload.balance === 'number') { - chips.push(metaChip('fa-coins', '积分余额 ' + payload.balance)); + if (chips.length) { + body += ''; } - body += ''; open( dlView('success', {