From 571c5110ee966f410244855b4edd3bd8490ba0a7 Mon Sep 17 00:00:00 2001 From: "97694732@qq.com" Date: Sat, 6 Jun 2026 11:31:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=87=BA=E7=89=88=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E8=BD=AC=E6=97=B6=E9=97=B4=E6=88=B3,=E7=A9=BA=E6=88=96?= =?UTF-8?q?=E6=97=A9=E4=BA=8E1970=E5=88=99=E4=BC=A00?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/upload/upload.vue | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pages/upload/upload.vue b/pages/upload/upload.vue index 6fe041a..d629ad9 100644 --- a/pages/upload/upload.vue +++ b/pages/upload/upload.vue @@ -2134,6 +2134,19 @@ export default { // 构建参数(用于计算签名) var timestamp = String(Math.floor(Date.now() / 1000)) + + // 出版时间转时间戳(1970-01-01 为 0) + var pubTimeStr = this.noIsbnPrintTime || '' + var pubTimestamp = '0' + if (pubTimeStr) { + var parts = pubTimeStr.split('-') + if (parts.length >= 2) { + var d = new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, 1) + var ts = Math.floor(d.getTime() / 1000) + if (ts >= 0) { pubTimestamp = String(ts) } + } + } + const params = { app_key: 'psi', client_id: 'psi', @@ -2145,7 +2158,7 @@ export default { f_book_name: '', author: this.noIsbnAuthor || '', publisher: this.noIsbnPublisher || '', - publication_time: this.noIsbnPrintTime || '', + publication_time: pubTimestamp, binding_layout: '', fix_price: this.noIsbnPrice ? String(Math.round(parseFloat(this.noIsbnPrice) * 100)) : '', page_count: '0',