|
@@ -29,9 +29,12 @@
|
|
<el-input placeholder="密码" prefix-icon="el-icon-lock" v-model="form.passwd" show-password></el-input>
|
|
<el-input placeholder="密码" prefix-icon="el-icon-lock" v-model="form.passwd" show-password></el-input>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item prop="mobile" class="firmRightName">
|
|
<el-form-item prop="mobile" class="firmRightName">
|
|
- <el-col :span="16"> <el-input placeholder="验证码" prefix-icon="el-icon-lock" v-model="input3"></el-input></el-col>
|
|
|
|
|
|
+ <el-col :span="16">
|
|
|
|
+ <el-input placeholder="验证码" prefix-icon="el-icon-lock" v-model="verifyForm.code" @keyup.enter="toSubmit"></el-input>
|
|
|
|
+ </el-col>
|
|
<el-col :span="8" class="firmRightImg">
|
|
<el-col :span="8" class="firmRightImg">
|
|
- <img :src="pic3" />
|
|
|
|
|
|
+ <!-- <img :src="pic3" /> -->
|
|
|
|
+ <verify v-model="verifyForm.code_id" ref="verifyPic"></verify>
|
|
</el-col>
|
|
</el-col>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
@@ -99,6 +102,7 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
import qrcode from '@/components/qrcode.vue';
|
|
import qrcode from '@/components/qrcode.vue';
|
|
|
|
+import verify from '@publics/src/components/verify.vue';
|
|
import { mapActions, mapState } from 'vuex';
|
|
import { mapActions, mapState } from 'vuex';
|
|
const jwt = require('jsonwebtoken');
|
|
const jwt = require('jsonwebtoken');
|
|
|
|
|
|
@@ -107,6 +111,7 @@ export default {
|
|
props: {},
|
|
props: {},
|
|
components: {
|
|
components: {
|
|
qrcode,
|
|
qrcode,
|
|
|
|
+ verify,
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
pic: require('@/assets/head.jpg'),
|
|
pic: require('@/assets/head.jpg'),
|
|
@@ -119,21 +124,32 @@ export default {
|
|
checked: false,
|
|
checked: false,
|
|
form: {},
|
|
form: {},
|
|
formLabelWidth: '60px',
|
|
formLabelWidth: '60px',
|
|
|
|
+ verifyForm: {},
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
this.initQrcode();
|
|
this.initQrcode();
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions(['corpLogin', 'createConnection', 'getWxtoken']),
|
|
|
|
|
|
+ ...mapActions(['corpLogin', 'createConnection', 'getWxtoken', 'verifyOperation']),
|
|
toSubmit() {
|
|
toSubmit() {
|
|
this.$refs.form.validate(valid => {
|
|
this.$refs.form.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
- this.submit();
|
|
|
|
|
|
+ // this.submit();
|
|
|
|
+ this.checkVerify();
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ async checkVerify() {
|
|
|
|
+ let result = await this.verifyOperation({ type: 'checkVerify', data: this.verifyForm });
|
|
|
|
+ if (`${result.errcode}` === '0') {
|
|
|
|
+ this.submit();
|
|
|
|
+ } else {
|
|
|
|
+ this.$message.error('验证码错误');
|
|
|
|
+ this.$refs.verifyPic.toCreated();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
async submit(wxtoken) {
|
|
async submit(wxtoken) {
|
|
let data = JSON.parse(JSON.stringify(this.form));
|
|
let data = JSON.parse(JSON.stringify(this.form));
|
|
if (this.loginType !== 0) {
|
|
if (this.loginType !== 0) {
|
|
@@ -149,6 +165,8 @@ export default {
|
|
let info = jwt.decode(result.data);
|
|
let info = jwt.decode(result.data);
|
|
sessionStorage.setItem('user', JSON.stringify(info));
|
|
sessionStorage.setItem('user', JSON.stringify(info));
|
|
this.$router.push({ path: '/' });
|
|
this.$router.push({ path: '/' });
|
|
|
|
+ } else {
|
|
|
|
+ this.$refs.verifyPic.toCreated();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
async initQrcode() {
|
|
async initQrcode() {
|