|
@@ -1,13 +1,21 @@
|
|
|
<script setup>
|
|
|
import { onHide, onLaunch, onShow } from '@dcloudio/uni-app'
|
|
|
import { usePageAuth } from '@/hooks/usePageAuth'
|
|
|
+import { useUserStore } from '@/store'
|
|
|
+
|
|
|
import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'
|
|
|
|
|
|
const mtpushModule = uni.requireNativePlugin('EL-MTPush')
|
|
|
usePageAuth()
|
|
|
|
|
|
+const userStore = useUserStore()
|
|
|
+const isLoggedIn = computed(() => !!userStore.token)
|
|
|
+
|
|
|
onLaunch(() => {
|
|
|
console.log('App Launch')
|
|
|
+ if (isLoggedIn.value) {
|
|
|
+ userStore.getUserInfo()
|
|
|
+ }
|
|
|
if (uni.getSystemInfoSync().platform === 'ios') {
|
|
|
mtpushModule.requestNotificationAuthorization((result) => {
|
|
|
const status = result.status
|