|
@@ -36,10 +36,33 @@
|
|
|
<el-form-item prop="code">
|
|
<el-form-item prop="code">
|
|
|
<el-input type="text" v-model="item.code"
|
|
<el-input type="text" v-model="item.code"
|
|
|
v-bind:class="{ active: codeErrorChecked }" auto-complete="off" class="msg" placeholder="短信验证码"></el-input>
|
|
v-bind:class="{ active: codeErrorChecked }" auto-complete="off" class="msg" placeholder="短信验证码"></el-input>
|
|
|
- <el-button type="primary" class="code"
|
|
|
|
|
- v-show="sendPersonalCode"
|
|
|
|
|
- @click="getCheckCode"
|
|
|
|
|
- :disabled="this.checkMobile">获取验证码</el-button>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-popover
|
|
|
|
|
+ placement="top"
|
|
|
|
|
+ width="300"
|
|
|
|
|
+ v-model="visible2">
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-input type="text"
|
|
|
|
|
+ v-model="ImgCode"
|
|
|
|
|
+ auto-complete="off"
|
|
|
|
|
+ class="code-input2"></el-input>
|
|
|
|
|
+ <img id="captchaImage2" class="code-img" src="/sso/login/checkCode"/>
|
|
|
|
|
+ <a class="code-click" @click="getCode" style="font-size: 12px">看不清换一张</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="text-align: right; margin: 0">
|
|
|
|
|
+ <el-button size="mini" type="text" @click="visible2 = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" size="mini" @click="getCheckCode">确定</el-button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <el-button type="primary" class="code"
|
|
|
|
|
+ v-show="sendPersonalCode" slot="reference" :disabled="this.checkMobile">获取验证码</el-button>
|
|
|
|
|
+ </el-popover>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ <!--<el-button type="primary" class="code"-->
|
|
|
|
|
+ <!--v-show="sendPersonalCode"-->
|
|
|
|
|
+ <!--@click="getCheckCode"-->
|
|
|
|
|
+ <!--:disabled="this.checkMobile">获取验证码</el-button>-->
|
|
|
|
|
+
|
|
|
<el-button type="primary" v-show="!sendPersonalCode" class="code code-send">已发送({{personal_time}}s)</el-button>
|
|
<el-button type="primary" v-show="!sendPersonalCode" class="code code-send">已发送({{personal_time}}s)</el-button>
|
|
|
<span v-show="codeErrorChecked" class="codeError-tip">{{codeErrorMsg}}</span>
|
|
<span v-show="codeErrorChecked" class="codeError-tip">{{codeErrorMsg}}</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -303,6 +326,8 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return {
|
|
return {
|
|
|
|
|
+ ImgCode: '',
|
|
|
|
|
+ visible2: false,
|
|
|
item: {
|
|
item: {
|
|
|
vipName: '',
|
|
vipName: '',
|
|
|
password: '',
|
|
password: '',
|
|
@@ -358,6 +383,7 @@
|
|
|
// 获取链接
|
|
// 获取链接
|
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
|
this.getUrl()
|
|
this.getUrl()
|
|
|
|
|
+ this.getCode()
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -514,21 +540,37 @@
|
|
|
// let { data } = await this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
|
|
// let { data } = await this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile}})
|
|
|
// this.token = data.token
|
|
// this.token = data.token
|
|
|
// },
|
|
// },
|
|
|
|
|
+ // 获取验证码
|
|
|
|
|
+ getCode () {
|
|
|
|
|
+ let imgSrc = document.getElementById('captchaImage2')
|
|
|
|
|
+ imgSrc.setAttribute('src', '/sso/resetPwd/checkCaptcha?timestamp=' + (new Date()).valueOf())
|
|
|
|
|
+ },
|
|
|
getCheckCode () {
|
|
getCheckCode () {
|
|
|
this.isShowLoading = true
|
|
this.isShowLoading = true
|
|
|
// this.getCode()
|
|
// this.getCode()
|
|
|
- this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile, timestamp: new Date().getTime() + ''}})
|
|
|
|
|
|
|
+ this.$http.get(`/sso/personal/register/checkCode`, {params: {mobile: this.item.mobile, timestamp: new Date().getTime() + '', code: this.ImgCode}})
|
|
|
.then(response => {
|
|
.then(response => {
|
|
|
this.isShowLoading = false
|
|
this.isShowLoading = false
|
|
|
if (response.data) {
|
|
if (response.data) {
|
|
|
this.token = response.data.token
|
|
this.token = response.data.token
|
|
|
|
|
+ if (response.data.errMsg) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ message: response.data.errMsg,
|
|
|
|
|
+ type: 'error'
|
|
|
|
|
+ })
|
|
|
|
|
+ this.ImgCode = ''
|
|
|
|
|
+ this.getCode()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
if (this.token !== '') {
|
|
if (this.token !== '') {
|
|
|
this.$message({
|
|
this.$message({
|
|
|
message: '验证码已经发送到您的手机,请注意查收',
|
|
message: '验证码已经发送到您的手机,请注意查收',
|
|
|
type: 'success'
|
|
type: 'success'
|
|
|
})
|
|
})
|
|
|
this.sendPersonalCode = false
|
|
this.sendPersonalCode = false
|
|
|
|
|
+ this.visible2 = false
|
|
|
this.personal_time = 60
|
|
this.personal_time = 60
|
|
|
|
|
+ this.ImgCode = ''
|
|
|
var personalTime = setInterval(() => {
|
|
var personalTime = setInterval(() => {
|
|
|
this.personal_time--
|
|
this.personal_time--
|
|
|
if (this.personal_time <= 0) {
|
|
if (this.personal_time <= 0) {
|
|
@@ -536,6 +578,7 @@
|
|
|
clearInterval(personalTime)
|
|
clearInterval(personalTime)
|
|
|
}
|
|
}
|
|
|
}, 1000)
|
|
}, 1000)
|
|
|
|
|
+ this.getCode()
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
return Promise.reject(response.data)
|
|
return Promise.reject(response.data)
|