|
|
@@ -13,6 +13,11 @@
|
|
|
type="tel"
|
|
|
></mt-field>
|
|
|
</div>
|
|
|
+ <div class="page-part">
|
|
|
+ <mt-field placeholder="验证码" v-model="code">
|
|
|
+ <img :src="imgSrc" height="45px" width="100px" @click="getCode">
|
|
|
+ </mt-field>
|
|
|
+ </div>
|
|
|
<div class="page-part">
|
|
|
<mt-field auto-complete="off"
|
|
|
placeholder="短信验证码"
|
|
|
@@ -99,6 +104,8 @@
|
|
|
name: 'registerEnterprise',
|
|
|
data () {
|
|
|
return {
|
|
|
+ code: '',
|
|
|
+ imgSrc: '',
|
|
|
step: 1,
|
|
|
state: {
|
|
|
mobile: 'error',
|
|
|
@@ -131,6 +138,11 @@
|
|
|
progress: '弱'
|
|
|
}
|
|
|
},
|
|
|
+ mounted () {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.getCode()
|
|
|
+ })
|
|
|
+ },
|
|
|
watch: {
|
|
|
'step1.token': {
|
|
|
handler (newVal) {
|
|
|
@@ -142,6 +154,9 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getCode () {
|
|
|
+ this.imgSrc = '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf()
|
|
|
+ },
|
|
|
// 注册
|
|
|
goRegister () {
|
|
|
window.location.href = `/register/personalRegistration${this.$store.state.option.fullPath}`
|
|
|
@@ -210,14 +225,25 @@
|
|
|
getCheckCode () {
|
|
|
if (this.tokenTime > 0 && this.tokenTime < 60) {
|
|
|
this.downToast('请稍后再点击,我在倒计时')
|
|
|
+ } else if (this.code === '') {
|
|
|
+ this.downToast('请输入验证码后获取!')
|
|
|
} else {
|
|
|
this.validateMobile()
|
|
|
if (this.state.mobile === 'success') {
|
|
|
this.$indicator.open('获取中...')
|
|
|
let _this = this
|
|
|
- this.$http.get('/sso/personal/register/checkCode', {params: {mobile: this.step1.mobile, timestamp: new Date().getTime() + ''}})
|
|
|
+ this.$http.get('/sso/personal/register/checkCode', {params: {mobile: this.step1.mobile, timestamp: new Date().getTime() + '', code: this.code}})
|
|
|
.then(response => {
|
|
|
this.$indicator.close()
|
|
|
+ if (response.data.errMsg) {
|
|
|
+ this.$toast({
|
|
|
+ message: response.data.errMsg,
|
|
|
+ iconClass: 'el-icon-error'
|
|
|
+ })
|
|
|
+ this.code = ''
|
|
|
+ this.getCode()
|
|
|
+ return
|
|
|
+ }
|
|
|
if (response.data) {
|
|
|
this.tokenCode = response.data.token
|
|
|
this.$toast({
|