| | |
| | | try { |
| | | console.log(11); |
| | | // 从URL参数中获取token和机构信息 |
| | | let { token, orgid, orgname, ZuHuID, deptCode, redirect } = |
| | | this.$route.query; |
| | | let { token, orgid, orgname, ZuHuID, deptCode } = this.$route.query; |
| | | // token = |
| | | // "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6Ijc5MWVkODNlLWE2MWYtNDI2MS05ZDZlLTNhOTVjYTU2YjZhMiJ9.q6jrRj8fwtb3FOqqwaxIFDr824hf85DW8heCj4qWYgRE55Pn0vkmcujFsYMrz9qqo047Gl7lv3rnok8pk7SKYQ"; // 验证必要参数 |
| | | // orgid = "30001002"; |
| | | if (!token) { |
| | | throw new Error("缺少认证令牌(token)"); |
| | | } |
| | | console.log(token); |
| | | console.log(orgid); |
| | | console.log(orgname); |
| | | // console.log(redirect,'redirect'); |
| | | |
| | | this.mateOrgid(orgid); |
| | | setToken(token); |
| | | this.$store.commit("SET_TOKEN", token); |
| | |
| | | |
| | | // 确定重定向路径 |
| | | let redirectPath = "/index"; |
| | | if (redirect) { |
| | | redirectPath = decodeURIComponent(redirect); |
| | | } else { |
| | | // if (redirect) { |
| | | // console.log(redirect,'888'); |
| | | |
| | | // redirectPath = decodeURIComponent(redirect); |
| | | // } else { |
| | | // 根据用户角色决定默认跳转页面 |
| | | const roles = this.$store.state.user.roles; |
| | | const username = this.$store.state.user.name; |
| | |
| | | } else { |
| | | redirectPath = "/followvisit/discharge"; |
| | | } |
| | | } |
| | | // } |
| | | |
| | | // 跳转到目标页面 |
| | | this.$router.replace({ path: redirectPath }); |