From 182f061354e1b15f78f6885a796db832607c463e Mon Sep 17 00:00:00 2001 From: kuaifan Date: Sun, 20 Apr 2025 22:30:46 +0800 Subject: [PATCH] no message --- app/Http/Controllers/Api/SystemController.php | 2 -- resources/assets/js/App.vue | 1 + resources/assets/js/app.js | 11 +------- resources/assets/js/store/actions.js | 25 +++++++++++++++++++ resources/mobile | 2 +- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/app/Http/Controllers/Api/SystemController.php b/app/Http/Controllers/Api/SystemController.php index ff2d2c898..b02b19c9d 100755 --- a/app/Http/Controllers/Api/SystemController.php +++ b/app/Http/Controllers/Api/SystemController.php @@ -3,8 +3,6 @@ namespace App\Http\Controllers\Api; use App\Models\UserDevice; -use App\Models\WebSocketDialog; -use App\Models\WebSocketDialogMsg; use Request; use Session; use Response; diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index a68385b20..63485451b 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -577,6 +577,7 @@ export default { this.autoTheme() $A.updateTimezone() $A.IDBTest() + this.$store.dispatch("safeAreaInsets") const nowYmd = $A.daytz().format('YYYY-MM-DD') if (this.lastCheckUpgradeYmd != nowYmd) { this.lastCheckUpgradeYmd = nowYmd diff --git a/resources/assets/js/app.js b/resources/assets/js/app.js index 8860cbaf9..916dd4e4a 100644 --- a/resources/assets/js/app.js +++ b/resources/assets/js/app.js @@ -340,16 +340,7 @@ const $preload = async () => { } const pageInfo = $A.eeuiAppGetPageInfo() || {}; store.state.isFirstPage = pageInfo.pageName === 'firstPage' - if (store.state.isFirstPage) { - $A.eeuiAppGetSafeAreaInsets().then(data => { - const proportion = data.height / window.outerHeight - store.state.safeAreaSize = { - top: Math.round(data.top / proportion * 100) / 100, - bottom: Math.round(data.bottom / proportion * 100) / 100, - data - } - }).catch(console.warn) - } + await store.dispatch("safeAreaInsets") } await store.dispatch("preload"); diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index d8ade8e5e..d2bcbe065 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -156,6 +156,31 @@ export default { }) }, + /** + * 获取安全区域 + * @param state + * @returns {Promise} + */ + safeAreaInsets({state}) { + return new Promise(resolve => { + if (!state.isFirstPage) { + return resolve(null) + } + $A.eeuiAppGetSafeAreaInsets().then(data => { + const proportion = data.height / window.outerHeight + state.safeAreaSize = { + top: Math.round(data.top / proportion * 100) / 100, + bottom: Math.round(data.bottom / proportion * 100) / 100, + data + } + resolve(state.safeAreaSize) + }).catch(e => { + console.warn(e) + resolve(null) + }) + }) + }, + /** * 访问接口 * @param state diff --git a/resources/mobile b/resources/mobile index 6f75cd3e8..51b61159d 160000 --- a/resources/mobile +++ b/resources/mobile @@ -1 +1 @@ -Subproject commit 6f75cd3e8687996031a8497cd6af1f210363827e +Subproject commit 51b61159deaff528c4def5bbdc5d0153f7f508a4