修改 离线插件
This commit is contained in:
41
src/App.vue
41
src/App.vue
@@ -4,16 +4,39 @@
|
||||
|
||||
|
||||
<script setup>
|
||||
// import { onLaunch } from '@dcloudio/uni-app';
|
||||
// onLaunch((opt) => {
|
||||
// console.log("onLaunch")
|
||||
import {showAlert} from '@/utils/message.js'
|
||||
import { onLaunch } from '@dcloudio/uni-app';
|
||||
onLaunch((opt) => {
|
||||
// uni.preloadPage({ url: "/pages/login/login" });
|
||||
// uni.preloadPage({ url: "/pages/home/home" });
|
||||
// uni.preloadPage({ url: "/pages/business/business" });
|
||||
// uni.preloadPage({ url: "/pages/notice/notice" });
|
||||
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
|
||||
console.log("APP onLaunch")
|
||||
|
||||
// #ifdef APP-PLUS
|
||||
uni.getPushClientId({
|
||||
success: (res) => {
|
||||
let push_clientid = res.cid
|
||||
console.log('客户端推送标识:', push_clientid);
|
||||
},
|
||||
fail(err) {
|
||||
console.log(err)
|
||||
}
|
||||
})
|
||||
|
||||
uni.onPushMessage(res => {
|
||||
console.log("收到推送消息:", res) //监听推送消息
|
||||
showAlert(JSON.stringify(res))
|
||||
uni.createPushMessage({
|
||||
title: res.data.title,
|
||||
content: res.data.content,
|
||||
payload: res.data.payload
|
||||
})
|
||||
})
|
||||
// #endif
|
||||
})
|
||||
|
||||
// uni.preloadPage({ url: "/pages/login/login" });
|
||||
// uni.preloadPage({ url: "/pages/home/home" });
|
||||
// uni.preloadPage({ url: "/pages/business/business" });
|
||||
// uni.preloadPage({ url: "/pages/notice/notice" });
|
||||
// uni.preloadPage({ url: "/pages/userinfo/userinfo" });
|
||||
// })
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user