!171 fix(app): iOS网络权限处理逻辑从app.vue迁移到首页page/index/index

Merge pull request !171 from wuKong/fix(app)-iOS网络权限检查
pull/172/head
芋道源码 2025-12-09 01:15:49 +00:00 committed by Gitee
commit aa83e4aa51
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 15 additions and 1 deletions

View File

@ -22,7 +22,7 @@
<script setup>
import { computed } from 'vue';
import { onLoad, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
import { onLoad, onShow, onPageScroll, onPullDownRefresh } from '@dcloudio/uni-app';
import sheep from '@/sheep';
import $share from '@/sheep/platform/share';
// tabBar
@ -79,6 +79,20 @@
}
});
onShow(async() => {
// #ifdef APP-PLUS
// ios
// uni.onNetworkStatusChangeuni.offNetworkStatusChange
// app.vue
//
if (sheep.$platform.os === 'ios') {
if (await sheep.$platform.checkNetwork()) {
await sheep.$store('app').init();
}
}
// #endif
});
//
onPullDownRefresh(() => {
sheep.$store('app').init();