WXL (wul)
16 小时以前 a9d2b856e0f6be6475319c2dc36bf405c2f908fc
src/views/loginSSO.vue
@@ -149,8 +149,22 @@
        // 3. 清理旧系统数据
        this.clearOldSystemData();
        const { token, orgid, orgname, ZuHuID, deptCode, redirect, campusid } =
          params;
        const {
          token,
          orgid,
          orgname,
          ZuHuID,
          deptCode,
          redirect,
          campusid,
          taskid,
          patid,
          id,
          Voicetype,
          visitCount,
          followUpDeptCode,
          followUpWardCode,
        } = params;
        console.log(
          token,
          orgid,
@@ -159,6 +173,8 @@
          deptCode,
          redirect,
          campusid,
             followUpDeptCode,
          followUpWardCode,
          "参数日志"
        );
@@ -204,9 +220,29 @@
        // 7. 处理重定向路径
        let redirectPath = "/followvisit/discharge";
        let redirectQuery = {};
        if (redirect) {
          // 解码传入的重定向路径
        // 7.1 如果存在 taskid,优先跳转到详情页并带上参数
        if (taskid) {
          redirectPath = "/followvisit/record/detailpage";
          redirectQuery = {
            taskid: taskid,
            patid: patid || "",
            id: id || "",
            Voicetype: Voicetype || "",
            visitCount: visitCount || "",
          };
          console.log("使用taskid跳转到详情页:", redirectPath, redirectQuery);
        } else if (followUpDeptCode || followUpWardCode) {
          // 7.2 携带科室/病区编码,跳转到出院随访列表并按科室/病区查询
          redirectPath = "/followvisit/discharge";
          redirectQuery = {
            followUpDeptCode: followUpDeptCode || "",
            followUpWardCode: followUpWardCode || "",
          };
          console.log("使用科室/病区编码跳转到出院随访列表:", redirectPath, redirectQuery);
        } else if (redirect) {
          // 7.3 如果传入的redirect存在,使用传入的重定向路径
          try {
            redirectPath = decodeURIComponent(redirect);
            console.log("使用传入的重定向路径:", redirectPath);
@@ -215,6 +251,7 @@
            redirectPath = this.getDefaultRedirectPath();
          }
        } else {
          // 7.4 使用默认路径
          redirectPath = this.getDefaultRedirectPath();
        }
@@ -224,11 +261,11 @@
        // 9. 延迟跳转,确保状态已更新
        setTimeout(() => {
          this.loadingDetail = "跳转到目标页面...";
          console.log("准备跳转到:", redirectPath);
          console.log("准备跳转到:", redirectPath, "参数:", redirectQuery);
          // ✅ 使用 push 而不是 replace,保留历史记录
          this.$router
            .push({ path: redirectPath })
            .push({ path: redirectPath, query: redirectQuery })
            .then(() => {
              console.log("SSO登录成功,跳转完成");
            })