From 77c4055c72fc5d0e0becaf3c410ab700f26c220b Mon Sep 17 00:00:00 2001
From: lrj <owen.stl@gmail.com>
Date: 星期六, 04 十月 2025 18:57:09 +0800
Subject: [PATCH] fix(auth): 避免在 JWT 过滤器中消费原始 GraphQL 请求体,防止下游读取为空引发 400
---
wx/pages/index/index.js | 38 ++++++++++++++++++++++++++++++++++++++
1 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/wx/pages/index/index.js b/wx/pages/index/index.js
index 3b64423..4c96146 100644
--- a/wx/pages/index/index.js
+++ b/wx/pages/index/index.js
@@ -32,6 +32,8 @@
onShow() {
console.log('棣栭〉鏄剧ず')
+ // 缁熶竴绯荤粺瀵艰埅鏍忔爣棰�
+ try { wx.setNavigationBarTitle({ title: '钃夋槗鍒�' }) } catch (e) {}
// 妫�鏌ョ櫥褰曠姸鎬�
if (!app.globalData.token) {
app.login()
@@ -203,6 +205,10 @@
}).then(data => {
if (data.activities) {
let newActivities = data.activities.content
+ // 璋冭瘯锛氳緭鍑烘姤鍚嶆埅姝㈠師濮嬪��
+ try {
+ console.log('娲诲姩鍘熷鎶ュ悕鎴:', newActivities.map(a => ({ id: a.id, name: a.name, signupDeadline: a.signupDeadline })))
+ } catch (e) {}
// 涓烘瘡涓椿鍔ㄦ坊鍔犲悕绉版枃瀛�
newActivities = newActivities.map(activity => ({
@@ -337,6 +343,38 @@
return utils.formatDate(date, 'MM-DD HH:mm')
},
+ // 璁捐绋块渶瑕佺殑 YYYY-MM-DD锛堝己鍏煎锛氱洿鎺ユ埅鍙栧墠10浣嶏紝閬垮厤 JSCore 鏃ユ湡瑙f瀽宸紓锛�
+ formatDateYYYYMMDD(date) {
+ if (!date && date !== 0) return '鈥�'
+ // 瀛楃涓诧細浼樺厛鍖归厤 YYYY-MM-DD 鐩存帴杩斿洖锛岄伩鍏嶈В鏋�
+ if (typeof date === 'string') {
+ const m = date.match(/^(\d{4}-\d{2}-\d{2})/)
+ if (m) return m[1]
+ }
+ // 鏁板�硷細鏃堕棿鎴筹紙绉�/姣锛夊厹搴�
+ if (typeof date === 'number') {
+ const ts = date > 1e12 ? date : date * 1000
+ const d = new Date(ts)
+ if (!isNaN(d.getTime())) {
+ const y = d.getFullYear()
+ const m = String(d.getMonth() + 1).padStart(2, '0')
+ const day = String(d.getDate()).padStart(2, '0')
+ return `${y}-${m}-${day}`
+ }
+ }
+ // 鍏朵粬鎯呭喌璧板伐鍏峰嚱鏁板厹搴�
+ const v = utils.formatDate(date, 'YYYY-MM-DD')
+ return v && typeof v === 'string' && v.trim() ? v : '鈥�'
+ },
+
+ // 鐐瑰嚮鈥滆鎯呪�濇寜閽紙涓庡崱鐗囩偣鍑讳竴鑷达級
+ onDetailTap(e) {
+ const id = e.currentTarget.dataset.id
+ if (id) {
+ this.goToActivityDetail(id)
+ }
+ },
+
// 鑾峰彇鐘舵�佹枃鏈�
getStatusText(state) {
const statusMap = {
--
Gitblit v1.8.0