zhangwencui
昨天 7a847e11f282e3dddc4183cd97b36b165cc18523
src/App.vue
@@ -7,6 +7,7 @@
<script setup>
  import { ref, onMounted } from "vue";
  import Splash from "./components/Splash.vue";
  import { confirmMessage } from "@/api/login.js";
  const showSplash = ref(true);
  onMounted(() => {
@@ -54,10 +55,31 @@
  // 处理推送消息点击事件
  const handlePushClick = msg => {
    console.log("点击推送消息:", msg);
    uni.navigateTo({
      url: "/" + msg.payload,
      // url: "/pages/managementMeetings/sealManagement/index?applicationNum=5",
    });
    console.log("解析后:", msg.payload.noticeId);
    try {
      confirmMessage(msg.payload.noticeId, 1).then(res => {
        if (msg.payload.url) {
          if (msg.payload.url.indexOf("/") === 0) {
            uni.navigateTo({
              url: msg.payload.url,
            });
          } else {
            uni.navigateTo({
              url: "/" + msg.payload.url,
            });
          }
        }
      });
    } catch (error) {
      uni.showToast({
        title: "路径:" + msg.payload,
        icon: "none",
      });
      uni.showToast({
        title: "跳转失败:" + error.message,
        icon: "none",
      });
    }
    // 解析并处理推送消息...
  };