验证码添加图形验证

This commit is contained in:
GGJ
2025-03-21 08:39:44 +08:00
parent 6023eac4fe
commit a388dec384
31 changed files with 1089 additions and 587 deletions

View File

@@ -50,12 +50,18 @@
<view class="textHigh">完成</view>
</button>
</view>
<!-- 图片滑块 -->
<tfVerify ref="tfVerifyRef" @chenggong="chenggong"/>
</view>
</template>
<script>
import back from '../../components/back.vue';
import tfVerify from '@/components/tfVerify/tfVerify.vue';
export default {
components:{
back,tfVerify
},
data() {
return {
pageNameFlag:1,
@@ -71,12 +77,13 @@
loadingFlag:false,
doneFlag:0,
sendAgain:'发送验证码',
sendAgainFlag:0,
sendAgainFlag:1,
resetFlag:0,
vercode:'',
second:60,
errorMsg:'',
disabledFlag:false
disabledFlag:false,
}
},
methods: {
@@ -114,6 +121,11 @@
that.seeFlag=0;
that.password='';
}
if( that.password.length>0 && that.again.length>0 ){
that.sendAgainFlag=0
}else{
that.sendAgainFlag=1
}
},
setAgain(e){
var that = this;
@@ -129,6 +141,11 @@
that.seeAgainFlag=0;
that.again='';
}
if( that.password.length>0 && that.again.length>0 ){
that.sendAgainFlag=0
}else{
that.sendAgainFlag=1
}
},
see(flag){
this.passwordFlag=flag;
@@ -137,18 +154,26 @@
this.againFlag=flag;
},
sendVercodeAgain(){
var that = this;
this.$refs.tfVerifyRef.open()
},
async chenggong() {
var that = this;
if(that.second!=60){
return;
}
that.sendAgainFlag=1
await that.authToken();
setTimeout(() => {
uni.request({
url: that.serverUrl+'/user/authCode',
method:'POST',
data: {
phone:that.phoneNum,
devCode:that.cid(),
type:3
type:3,
authToken: that.authTokenId
},
header: {
'content-type': 'application/x-www-form-urlencoded'
@@ -191,8 +216,10 @@
}
});
}
});
},
}, 500);
},
complete(){
var that = this;
var password = that.password.trim();
@@ -280,9 +307,7 @@
onLoad(e) {
this.phoneNum=e.phoneNum;
},
components:{
back
}
}
</script>