Browse Source

图形验证

master
luyisha 2 years ago
parent
commit
e0e980875d
  1. 1
      api/serve/index.js
  2. 55
      layout/vCode.vue
  3. 75
      pages/reg/index.vue

1
api/serve/index.js

@ -87,6 +87,7 @@ x.fn = x.prototype = {
if(newMsg!='_user_walletImage'&& newMsg!='_user_getAuthInfo' && newMsg!='_user_withdrawalBalance'
&& newMsg!='_wallet_getBalance' && newMsg!='_contract_getMarketInfo'&& newMsg!='_contract_openNum'
&& newMsg!='_user_primaryAuth' && newMsg!='_user_subscribeTokenList'
&& newMsg!='_user_wdcode' && newMsg!='_register_Graph_che' && newMsg!='_register_sendEmailCode'
&& newMsg!='_user_subscribeRecords' && newMsg!='_user_subscribeNow' && newMsg!='_exchange_getMarketInfo'
&& newMsg!='_indexList'&& newMsg!='_user_subscribe'&& newMsg!='_contract_getSymbolDetail' && newMsg!='_user_withdrawalRecord'){
resolve(Cache.get(newMsg).data);

55
layout/vCode.vue

@ -52,15 +52,6 @@ export default {
watch: {
sendAAA(n,o){
if(n){
console.log(n, '-------');
// setTimeout(()=>{
// this.inSend = false;
// this.load = true;
// this.countDown();
// this.$toast(this.$t('common.sendSuccess'));
// this.$emit('changeSendAAA', false)
// }, 500)
// return;
this.send();
}
}
@ -84,7 +75,7 @@ export default {
methods: {
//
send() {
console.log(this.sendAAA, '-------this.sendAAA');
// console.log(this.sendAAA, '-------this.sendAAA');
if(this.data.phone==''){
this.$toast(this.$t('reg.a3'))
return
@ -95,28 +86,30 @@ export default {
}
if (this.load) return;
this.inSend = true;
if(this.url==="/register/sendEmailCode" && !this.sendAAA){
this.$emit('changeSLider', true);
}else{
// if(this.url==="/register/sendEmailCode" && !this.sendAAA){
// this.$emit('changeSLider', true);
// return;
// }
// serve.post(this.url, this.data)
Member.sendEmailCode(this.data)
.then((res) => {
if(res.code=='4001'){
this.inSend = false
this.$toast(res.message);
}else{
this.inSend = false;
this.load = true;
this.countDown();
this.$toast(this.$t('common.sendSuccess'));
this.$emit('changeSendAAA', false)
}
})
.catch(() => {
this.inSend = false;
});
}
Member.sendEmailCode(this.data)
.then((res) => {
if(res.code=='4001'){
this.inSend = false
this.$toast(res.message);
//
this.$emit('reGetGraphChe')
}else{
this.inSend = false;
this.load = true;
this.countDown();
this.$toast(this.$t('common.sendSuccess'));
// this.$emit('changeSendAAA', false)
}
})
.catch(() => {
this.inSend = false;
});
},
countDown() {

75
pages/reg/index.vue

@ -70,26 +70,26 @@
</view>
</template>
</view>
<!--图形验证码-->
<view class="form-item border-b m-b-md p-b-xs" v-if="0">
<view class="label m-b-xs">{{$t('homeNewText.ee6')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('homeNewText.ee6')">
<template #right>
<!-- 邮箱 -->
<!--<img :src="'api/app/register/Graph_che?'+Math.random()" @click="refreshCaptcha">-->
<img :src="Graph_che" @click="gett_gc_code">
<!--<v-code-->
<!-- url="/register/sendEmailCode"-->
<!-- :data="{-->
<!-- email:form.account,-->
<!-- type:1-->
<!--}"-->
<!-- v-show="form.type==2"-->
<!--&gt;</v-code>-->
</template>
</v-input>
<!--<img src="https://xmg.xuscoins.com/api/app/register/Graph_che?0.5386844216396525"/>-->
</view>
<!--图形验证码-->
<view class="form-item border-b m-b-md p-b-xs">
<view class="label m-b-xs">{{$t('homeNewText.ee6')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('homeNewText.ee6')">
<template #right>
<!-- 邮箱 -->
<!--<img :src="'api/app/register/Graph_che?'+Math.random()" @click="refreshCaptcha">-->
<img :src="Graph_che" @click="gett_gc_code" v-if="!hideImg">
<!--<v-code-->
<!-- url="/register/sendEmailCode"-->
<!-- :data="{-->
<!-- email:form.account,-->
<!-- type:1-->
<!--}"-->
<!-- v-show="form.type==2"-->
<!--&gt;</v-code>-->
</template>
</v-input>
<!--<img src="https://xmg.xuscoins.com/api/app/register/Graph_che?0.5386844216396525"/>-->
</view>
<view class="form-item border-b m-b-md p-b-xs">
<view class="label m-b-xs">{{$t('reg.a6')}}</view>
<v-input class="color-light" v-model="form.code" :placeholder="$t('reg.a7')">
@ -109,12 +109,12 @@
url="/register/sendEmailCode"
:data="{
email:form.account,
type:1
type:1,
gc_code: form.gr_code,
gc_key: gc_key
}"
v-show="form.type==2"
@changeSLider="changeSLider"
:sendAAA="sendAAA"
@changeSendAAA="sendAAA = false"
@reGetGraphChe="reGetGraphChe"
></v-code>
</template>
</v-input>
@ -194,15 +194,16 @@ export default {
agreement: {},
country_code:'',
showVerify:false,
imgs:[{
src:'/static/verify/0.jpeg',
color:'#38a7b7'
},{
src:'/static/verify/1.jpeg',
color:'#485967'
}],
sendAAA: false,
showVerify:false,
imgs:[{
src:'/static/verify/0.jpeg',
color:'#38a7b7'
},{
src:'/static/verify/1.jpeg',
color:'#485967'
}],
sendAAA: false,
hideImg: false
};
},
@ -282,9 +283,17 @@ export default {
console.log(error);
});
},
//
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;
this.gc_key= res.data.key;

Loading…
Cancel
Save