Browse Source

图形验证

master
luyisha 2 years ago
parent
commit
e0e980875d
  1. 1
      api/serve/index.js
  2. 25
      layout/vCode.vue
  3. 21
      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' if(newMsg!='_user_walletImage'&& newMsg!='_user_getAuthInfo' && newMsg!='_user_withdrawalBalance'
&& newMsg!='_wallet_getBalance' && newMsg!='_contract_getMarketInfo'&& newMsg!='_contract_openNum' && newMsg!='_wallet_getBalance' && newMsg!='_contract_getMarketInfo'&& newMsg!='_contract_openNum'
&& newMsg!='_user_primaryAuth' && newMsg!='_user_subscribeTokenList' && 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!='_user_subscribeRecords' && newMsg!='_user_subscribeNow' && newMsg!='_exchange_getMarketInfo'
&& newMsg!='_indexList'&& newMsg!='_user_subscribe'&& newMsg!='_contract_getSymbolDetail' && newMsg!='_user_withdrawalRecord'){ && newMsg!='_indexList'&& newMsg!='_user_subscribe'&& newMsg!='_contract_getSymbolDetail' && newMsg!='_user_withdrawalRecord'){
resolve(Cache.get(newMsg).data); resolve(Cache.get(newMsg).data);

25
layout/vCode.vue

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

21
pages/reg/index.vue

@ -71,13 +71,13 @@
</template> </template>
</view> </view>
<!--图形验证码--> <!--图形验证码-->
<view class="form-item border-b m-b-md p-b-xs" v-if="0"> <view class="form-item border-b m-b-md p-b-xs">
<view class="label m-b-xs">{{$t('homeNewText.ee6')}}</view> <view class="label m-b-xs">{{$t('homeNewText.ee6')}}</view>
<v-input class="color-light" v-model="form.gr_code" :placeholder="$t('homeNewText.ee6')"> <v-input class="color-light" v-model="form.gr_code" :placeholder="$t('homeNewText.ee6')">
<template #right> <template #right>
<!-- 邮箱 --> <!-- 邮箱 -->
<!--<img :src="'api/app/register/Graph_che?'+Math.random()" @click="refreshCaptcha">--> <!--<img :src="'api/app/register/Graph_che?'+Math.random()" @click="refreshCaptcha">-->
<img :src="Graph_che" @click="gett_gc_code"> <img :src="Graph_che" @click="gett_gc_code" v-if="!hideImg">
<!--<v-code--> <!--<v-code-->
<!-- url="/register/sendEmailCode"--> <!-- url="/register/sendEmailCode"-->
<!-- :data="{--> <!-- :data="{-->
@ -109,12 +109,12 @@
url="/register/sendEmailCode" url="/register/sendEmailCode"
:data="{ :data="{
email:form.account, email:form.account,
type:1 type:1,
gc_code: form.gr_code,
gc_key: gc_key
}" }"
v-show="form.type==2" v-show="form.type==2"
@changeSLider="changeSLider" @reGetGraphChe="reGetGraphChe"
:sendAAA="sendAAA"
@changeSendAAA="sendAAA = false"
></v-code> ></v-code>
</template> </template>
</v-input> </v-input>
@ -203,6 +203,7 @@ export default {
color:'#485967' color:'#485967'
}], }],
sendAAA: false, sendAAA: false,
hideImg: false
}; };
}, },
@ -282,9 +283,17 @@ export default {
console.log(error); console.log(error);
}); });
}, },
//
reGetGraphChe(){
this.hideImg = true;
this.gett_gc_code();
},
gett_gc_code(){ gett_gc_code(){
Member.Graph_che().then((res)=>{ Member.Graph_che().then((res)=>{
if(res.code==200){
this.hideImg = false;
}
console.log("gc",res.data.img) console.log("gc",res.data.img)
this.Graph_che = res.data.img; this.Graph_che = res.data.img;
this.gc_key= res.data.key; this.gc_key= res.data.key;

Loading…
Cancel
Save