From 2d8ffd842a52c409b3e0a5bc480b312d37400faa Mon Sep 17 00:00:00 2001 From: Blizzard Date: Sat, 14 Feb 2026 13:17:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=20=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84console=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 2 +- app.json | 3 ++- pages/profile/badges/level-detail/index.js | 8 ++++---- pages/profile/index.js | 2 +- project.private.config.json | 2 +- utils/request.js | 6 +++--- utils/subscribe.js | 4 ++-- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app.js b/app.js index 2da3956..42ebb66 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,7 @@ App({ if (token && typeof token === 'string') { wx.setStorageSync('token', token); - console.log('Login successful'); + if (this._resolveLogin) this._resolveLogin(token); // Background Profile Update diff --git a/app.json b/app.json index 90faf10..53998c2 100644 --- a/app.json +++ b/app.json @@ -65,5 +65,6 @@ } ] }, - "sitemapLocation": "sitemap.json" + "sitemapLocation": "sitemap.json", + "lazyCodeLoading": "requiredComponents" } \ No newline at end of file diff --git a/pages/profile/badges/level-detail/index.js b/pages/profile/badges/level-detail/index.js index a916e5f..20437c3 100644 --- a/pages/profile/badges/level-detail/index.js +++ b/pages/profile/badges/level-detail/index.js @@ -26,7 +26,7 @@ Page({ try { // Fetch levels const levelRes = await request.get('/config/level/list'); - console.log('Level Detail - API Response:', levelRes); + let list = []; if (levelRes) { @@ -41,14 +41,14 @@ Page({ } } - console.log('Level Detail - Parsed List:', list); + list.sort((a, b) => a.minSunlight - b.minSunlight); // Fetch profile if sunlight not passed let currentSunlight = passedSunlight; if (currentSunlight === undefined) { const profileRes = await request.get('/profile/detail'); - console.log('Level Detail - Profile:', profileRes); + currentSunlight = profileRes.totalSunlight || 0; this.setData({ currentSunlight }); } @@ -63,7 +63,7 @@ Page({ } } - console.log('Level Detail - Calculated Level:', currentLevel); + this.setData({ levels: list, diff --git a/pages/profile/index.js b/pages/profile/index.js index 208a639..e0c2627 100644 --- a/pages/profile/index.js +++ b/pages/profile/index.js @@ -130,7 +130,7 @@ Page({ // Open WeChat notification settings wx.openSetting({ success: (res) => { - console.log('Settings opened', res); + } }); }, diff --git a/project.private.config.json b/project.private.config.json index e1ffeca..1a50a2c 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -3,7 +3,7 @@ "projectname": "plant-mp", "condition": {}, "setting": { - "urlCheck": false, + "urlCheck": true, "coverView": true, "lazyloadPlaceholderEnable": false, "skylineRenderEnable": false, diff --git a/utils/request.js b/utils/request.js index 7c84974..bb6108a 100644 --- a/utils/request.js +++ b/utils/request.js @@ -63,7 +63,7 @@ class WxRequest { if ((statusCode === 401 || data.code === 401) && !options.skipToken && !options._retry) { const app = getApp(); if (app && app.forceRefreshLogin) { - console.log('401 detected, refreshing token...'); + app.forceRefreshLogin().then(() => { // Retry Original Request this.request({ ...options, _retry: true }) @@ -270,8 +270,8 @@ class WxRequest { // Initialize with default instance const request = new WxRequest({ - baseUrl: 'http://192.168.0.184:8889', - //baseUrl: 'https://go.sundynix.cn/api', + //baseUrl: 'http://192.168.0.184:8889', + baseUrl: 'https://go.sundynix.cn/api', header: { 'Content-Type': 'application/json' } diff --git a/utils/subscribe.js b/utils/subscribe.js index 0fda9e9..8c541b8 100644 --- a/utils/subscribe.js +++ b/utils/subscribe.js @@ -17,10 +17,10 @@ export const requestSubscription = () => { tmplIds: [TEMPLATE_ID], success(res) { if (res[TEMPLATE_ID] === 'accept') { - console.log('Subscription accepted'); + resolve({ success: true, status: 'accept' }); } else { - console.log('Subscription rejected or other status', res[TEMPLATE_ID]); + resolve({ success: false, status: res[TEMPLATE_ID] }); } },