feat(app): 初始化逻辑中增加iOS网络权限检查

- 在onShow生命周期中添加异步处理
- 引入sheep对象用于平台判断和网络检测
- iOS平台下网络授权后重新加载应用初始化
- 优化应用启动时的网络状态处理逻辑
pull/171/head
wuKong 2025-12-08 18:45:48 +08:00
parent 5724bc61b0
commit ee25d77d58
1 changed files with 9 additions and 3 deletions

12
App.vue
View File

@ -1,7 +1,6 @@
<script setup>
import { onLaunch, onShow, onError } from '@dcloudio/uni-app';
import { ShoproInit } from './sheep';
import { sheep, ShoproInit } from '@/sheep';
onLaunch(() => {
// 使
uni.hideTabBar({
@ -12,7 +11,7 @@
ShoproInit();
});
onShow(() => {
onShow(async () => {
// #ifdef APP-PLUS
// urlSchemes
const args = plus.runtime.arguments;
@ -23,6 +22,13 @@
uni.getClipboardData({
success: (res) => {},
});
// ios
if (sheep.$platform.os === 'ios') {
if (await sheep.$platform.checkNetwork()) {
await sheep.$store('app').init();
}
}
// #endif
});
</script>