diff --git a/src/views/common/phoneweblogin.vue b/src/views/common/phoneweblogin.vue index cd2d333..f61780a 100644 --- a/src/views/common/phoneweblogin.vue +++ b/src/views/common/phoneweblogin.vue @@ -43,6 +43,7 @@ import { getUUID } from '@/utils' import { apiLogin, apiSsysSendSMS } from '@/api/api_sys' import { apiDingtalkLogin } from '@/api/api_staff' import * as dd from 'dingtalk-jsapi' +import Vue from 'vue' var dingCode = '' export default { data () { @@ -71,6 +72,11 @@ export default { // this.handleGetImgCaptcha() }, mounted () { + if (this.checkToken()) { + if (this.$route.query.do) { + this.$router.replace({ name: this.$route.query.do }) + } + } }, methods: { // // 获取图像验证码 @@ -78,6 +84,14 @@ export default { // this.dataForm.uuid = getUUID() // this.captchaPath = `/lz_management/captcha.jpg?uuid=${this.dataForm.uuid}` // }, + checkToken() { + console.log('检查token') + let token = Vue.cookie.get('token') + if (!token || !/\S/.test(token)) { + return false; + } + return true + }, // 登录提交表单 handleLogin () { let param = Object.assign(this.dataForm, {'userName': this.dataForm.userName}, {'uuid': this.dataForm.uuid}, {'verifyCode': this.dataForm.verify}) @@ -119,7 +133,7 @@ export default { uuid: this.dataForm.uuid } apiSsysSendSMS(parmse).then(res => { - if (res.code == 200) { + if (res.code === 200) { this.time = 60 this.hasSendCode = true this.timer = setInterval(() => {