| | |
| | | loginInfo: { |
| | | firstLogin: 1 |
| | | }, |
| | | roles:[], |
| | | newPassword: undefined, |
| | | confirmPassword: undefined, |
| | | loginRules: { |
| | |
| | | this.$store.dispatch("Login", this.loginForm).then((res) => { |
| | | getInfo().then(loginInfo => { |
| | | this.loginInfo = loginInfo.user |
| | | this.roles = loginInfo.roles |
| | | //如果返回为1正常跳转 |
| | | if (this.loginInfo.firstLogin == 1) { |
| | | // this.$router.push({ path: "/" }).catch(() => { }); |
| | | // return; |
| | | if (this.loginInfo.roles.includes("admin") || this.loginInfo.roles.includes("city_leader") || this.loginInfo.roles.includes("county_leader")) { |
| | | this.$router.push({path: this.redirect || "/screen"}).catch(() => { |
| | | }); |
| | | if (this.roles .includes("admin") || this.roles .includes("city_leader") || this.roles .includes("county_leader")) { |
| | | this.$router.push({ |
| | | path: '/screen' |
| | | }) |
| | | } else { |
| | | this.$router.push({path: this.redirect || "/index"}).catch(() => { |
| | | }); |