| | |
| | | // 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, |
| | | } = params; |
| | | console.log( |
| | | token, |
| | | orgid, |
| | |
| | | |
| | | // 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 (redirect) { |
| | | // 7.2 如果传入的redirect存在,使用传入的重定向路径 |
| | | try { |
| | | redirectPath = decodeURIComponent(redirect); |
| | | console.log("使用传入的重定向路径:", redirectPath); |
| | |
| | | redirectPath = this.getDefaultRedirectPath(); |
| | | } |
| | | } else { |
| | | // 7.3 使用默认路径 |
| | | redirectPath = this.getDefaultRedirectPath(); |
| | | } |
| | | |
| | |
| | | // 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登录成功,跳转完成"); |
| | | }) |