| | |
| | | </template> |
| | | |
| | | <script> |
| | | import Layout from "@/page/index/" |
| | | import { mapGetters } from "vuex" |
| | | import { info } from "@/api/system/tenant" |
| | | // import {getCaptcha} from "@/api/user"; |
| | |
| | | }, |
| | | props: [], |
| | | methods: { |
| | | refreshCode () { |
| | | if (this.website.captchaMode) { |
| | | getCaptcha().then(res => { |
| | | const data = res.data |
| | | this.loginForm.key = data.key |
| | | this.loginForm.image = data.image |
| | | }) |
| | | } |
| | | }, |
| | | // refreshCode () { |
| | | // if (this.website.captchaMode) { |
| | | // getCaptcha().then(res => { |
| | | // const data = res.data |
| | | // this.loginForm.key = data.key |
| | | // this.loginForm.image = data.image |
| | | // }) |
| | | // } |
| | | // }, |
| | | showPassword () { |
| | | this.passwordType === "" |
| | | ? (this.passwordType = "password") |
| | |
| | | text: '登录中,请稍后。。。', |
| | | spinner: "el-icon-loading" |
| | | }) |
| | | this.$store.dispatch("LoginByUsername", this.loginForm).then(() => { |
| | | this.$store.dispatch("LoginByUsername", this.loginForm).then((res) => { |
| | | if (this.website.switchMode) { |
| | | const deptId = this.userInfo.dept_id |
| | | const roleId = this.userInfo.role_id |
| | |
| | | return false |
| | | } |
| | | } |
| | | this.$router.push({ path: this.tagWel.value }) |
| | | |
| | | if (JSON.stringify(res) == '{}') { |
| | | this.$router.push({ path: this.tagWel.value }) |
| | | } else { |
| | | this.$router.$avueRouter.formatRoutes(res.menuData, true) |
| | | |
| | | this.$router.push({ path: res.fistMenu.path }) |
| | | } |
| | | |
| | | loading.close() |
| | | }).catch(() => { |
| | | loading.close() |
| | | this.refreshCode() |
| | | // this.refreshCode() |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | getTenant () { |
| | | let domain = getTopUrl() |
| | | // 临时指定域名,方便测试 |