Browse Source

图形验证码

master
luyisha 2 years ago
parent
commit
66b19809ae
  1. 2
      layout/vCode.vue
  2. 35
      pages/assets/draw.vue
  3. 3
      pages/base/home.vue
  4. 6
      pages/safe/forget-password.vue
  5. 8
      pages/safe/login-password.vue

2
layout/vCode.vue

@ -77,7 +77,7 @@ export default {
this.inSend = true;
serve.post(this.url, this.data)
.then(() => {
if(res.code!=='200'){//4001|1004
if(res.code!='200'){//4001|1004
this.inSend = false
//
if(this.url=='/register/sendEmailCode'){

35
pages/assets/draw.vue

@ -116,16 +116,18 @@
</v-input>
</view>
<!-- 图形验证码 -->
<view class="d-flex align-center p-y-xs m-t-ms justify-between color-light fn-15">
<span>{{ $t("reg.a8") }}</span>
<!-- <span class="color-light">{{ withdrawFee.withdrawal_fee }} {{coin}}</span> -->
<span>{{ $t("common.GraphicValidation") }}</span>
</view>
<view class="d-flex align-end p-y-xs justify-between bg-form-panel-3 rounded-xs p-y-sm">
<v-input type="password" v-model="form.password" class="p-x-ms color-light w-max fn-13 rounded-xs" :placeholder="$t('reg.a9')">
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('common.GraphicValidation')">
<template #right>
<img :src="Graph_che" @click="gett_gc_code" v-if="!hideImg">
</template>
</v-input>
</view>
<view class="d-flex align-center p-y-xs m-t-ms justify-between color-light fn-15">
<span>{{ $t("safe.a5") }}</span>
</view>
@ -255,6 +257,7 @@ export default {
code_type: 1,
code: '',
emailcode: '',
gr_code: '',//Graphic verification code
},
withdrawFee: {},
list: [],
@ -265,6 +268,8 @@ export default {
getEmailCodeLock: false,
JStime: 0,
tiemr: null,
Graph_che: '',
hideImg: false
};
},
computed: {
@ -340,6 +345,10 @@ export default {
this.$toast(this.$t('reg.a9'))
return
}
if (!this.form.gr_code) {
this.$toast(this.$t('common.GraphicValidation'))
return
}
if(this.getEmailCodeLock){return};
this.JStime = 300;
this.tiemr = setInterval(()=>{
@ -407,6 +416,7 @@ export default {
this.form.code = ''
if (res.code == 4001) {
this.$toast(res.message);
this.reGetGraphChe();//
} else {
this.$toast.success(this.$t("assets.d5") + "!");
this.form.amount = ''
@ -459,9 +469,24 @@ export default {
changeTab(ev) {
this.form.code_type = ev.detail.name
},
//
reGetGraphChe(){
this.hideImg = true;
this.gett_gc_code();
},
gett_gc_code(){
Member.Graph_che().then((res)=>{
if(res.code==200){
this.hideImg = false;
}
console.log("gc",res.data.img)
this.Graph_che = res.data.img;
});
}
},
created() {
this.getWithdrawRecords();
this.gett_gc_code();
},
};
</script>

3
pages/base/home.vue

@ -734,7 +734,8 @@ export default {
},
goExchange() {
this.show = false;
this.tabChange('exchange-operation')
// this.tabChange('exchange-operation')
this.tabChange('mine')
},
goReg(){
uni.navigateTo({

6
pages/safe/forget-password.vue

@ -23,8 +23,8 @@
</view>
<!--图形验证码-->
<view class="form-item border-b p-md">
<view class="label m-b-xs">{{$t('homeNewText.ee6')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('homeNewText.ee6')">
<view class="label m-b-xs">{{$t('common.GraphicValidation')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('common.GraphicValidation')">
<template #right>
<img :src="Graph_che" @click="gett_gc_code" v-if="!hideImg">
</template>
@ -44,7 +44,7 @@
</view>
</view>
<view class="form-item border-b p-md" v-if="checkData.email_status==1">
<view class="label m-b-xs">{{$t('safe.a5')}}</view>
<view class="label m-b-xs">{{$t('safe.a5')}}AA</view>
<view class="input color-light">
<v-input v-model="form.email_code" :placeholder="$t('safe.a6')">
<template #right>

8
pages/safe/login-password.vue

@ -22,8 +22,8 @@
</view>
<view class="form-item border-b p-md">
<view class="label m-b-xs">{{$t('homeNewText.ee6')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('homeNewText.ee6')">
<view class="label m-b-xs">{{$t('common.GraphicValidation')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('common.GraphicValidation')">
<template #right>
<img :src="Graph_che" @click="gett_gc_code" v-if="!hideImg">
</template>
@ -126,9 +126,11 @@ export default {
setPassword() {
let data = this.form;
Setting.updatePassword(data, { btn: this.$refs.btn })
.then(() => {
.then((res) => {
if(res.code==200){
this.$back();
this.$toast.success(this.$t('safe.d3'));
}
})
.catch(() => {});
},

Loading…
Cancel
Save