| | |
| | | import {info} from "@/api/system/tenant" |
| | | import {getCaptcha} from "@/api/user" |
| | | import {getTopUrl} from "@/util/util" |
| | | import {Message} from "element-ui"; |
| | | |
| | | export default { |
| | | name: "userlogin", |
| | |
| | | }) |
| | | this.$store |
| | | .dispatch("LoginByUsername", this.loginForm) |
| | | .then(() => { |
| | | console.log("userInfo",this.userInfo) |
| | | this.$store.dispatch("GetMenu", [this.userInfo, ""]).then((data) => { |
| | | //登录跳转首页改完跳转保安单位情况智能分析 |
| | | let path = this.tagWel.value |
| | | |
| | | let menu = data.filter(e => e.path == "/securityAnalysis/index") |
| | | if (menu.length > 0) { |
| | | path = '/securityAnalysis' |
| | | } |
| | | if (this.userInfo.role_name.indexOf("考勤管理员") > -1) { |
| | | path = "check/record" |
| | | } |
| | | this.$router.push({path: path}) |
| | | .then((data) => { |
| | | if (data.error_description) { |
| | | loading.close() |
| | | }); |
| | | }else{ |
| | | this.$store.dispatch("GetMenu", [this.userInfo, ""]).then((data) => { |
| | | //登录跳转首页改完跳转保安单位情况智能分析 |
| | | let path = this.tagWel.value |
| | | |
| | | let menu = data.filter(e => e.path == "/securityAnalysis/index") |
| | | if (menu.length > 0) { |
| | | path = '/securityAnalysis' |
| | | } |
| | | if (this.userInfo.role_name.indexOf("考勤管理员") > -1) { |
| | | path = "check/record" |
| | | } |
| | | this.$router.push({path: path}) |
| | | loading.close() |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | loading.close() |