|
@@ -46,11 +46,20 @@
|
|
</el-input>
|
|
</el-input>
|
|
</el-col>
|
|
</el-col>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item prop="mobile" class="firmRightName">
|
|
|
|
+ <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">
|
|
|
|
+ <!-- <img :src="pic3" /> -->
|
|
|
|
+ <verify v-model="verifyForm.code_id" ref="verifyPic"></verify>
|
|
|
|
+ </el-col>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</el-col>
|
|
</el-col>
|
|
- <el-col class="inp_sty">
|
|
|
|
|
|
+ <el-col class="inp_sty" :span="24">
|
|
<!-- <el-col :span="19" style="padding: 8px 0;"><el-checkbox v-model="checked">记住登陆账号</el-checkbox></el-col> -->
|
|
<!-- <el-col :span="19" style="padding: 8px 0;"><el-checkbox v-model="checked">记住登陆账号</el-checkbox></el-col> -->
|
|
- <el-col :span="5"><el-button type="success" class="login" @click="toSubmit">登录</el-button></el-col>
|
|
|
|
|
|
+ <el-col :span="24"><el-button type="success" class="login" @click="toSubmit">登录</el-button></el-col>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col><el-link type="primary" class="login_tips" :underline="false">忘记登陆密码?</el-link></el-col>
|
|
<el-col><el-link type="primary" class="login_tips" :underline="false">忘记登陆密码?</el-link></el-col>
|
|
</el-row>
|
|
</el-row>
|
|
@@ -75,6 +84,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');
|
|
export default {
|
|
export default {
|
|
@@ -82,6 +92,7 @@ export default {
|
|
props: {},
|
|
props: {},
|
|
components: {
|
|
components: {
|
|
qrcode,
|
|
qrcode,
|
|
|
|
+ verify,
|
|
},
|
|
},
|
|
data: () => ({
|
|
data: () => ({
|
|
img: {
|
|
img: {
|
|
@@ -97,21 +108,32 @@ export default {
|
|
account: [{ required: true, message: '请输入学号', trigger: 'blur' }],
|
|
account: [{ required: true, message: '请输入学号', trigger: 'blur' }],
|
|
passwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
|
passwd: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
|
},
|
|
},
|
|
|
|
+ verifyForm: {},
|
|
}),
|
|
}),
|
|
created() {
|
|
created() {
|
|
this.initQrcode();
|
|
this.initQrcode();
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
methods: {
|
|
methods: {
|
|
- ...mapActions(['studLogin', 'createConnection', 'getWxtoken']),
|
|
|
|
|
|
+ ...mapActions(['studLogin', '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) {
|
|
@@ -129,6 +151,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() {
|
|
@@ -158,7 +182,6 @@ export default {
|
|
padding: 15% 0;
|
|
padding: 15% 0;
|
|
}
|
|
}
|
|
.mainRight {
|
|
.mainRight {
|
|
- height: 310px;
|
|
|
|
background: #fff;
|
|
background: #fff;
|
|
border-radius: 10px;
|
|
border-radius: 10px;
|
|
padding: 32px 40px;
|
|
padding: 32px 40px;
|
|
@@ -184,6 +207,7 @@ export default {
|
|
}
|
|
}
|
|
.inp_sty {
|
|
.inp_sty {
|
|
padding: 5px 0;
|
|
padding: 5px 0;
|
|
|
|
+ text-align: center;
|
|
}
|
|
}
|
|
.tit_right {
|
|
.tit_right {
|
|
font-size: 18px !important;
|
|
font-size: 18px !important;
|