Browse Source

忘记密码-增加图形验证码

master
luyisha 3 years ago
parent
commit
60226c225d
  1. 2
      pages/reg/index.vue
  2. 46
      pages/safe/forget-password.vue

2
pages/reg/index.vue

@ -190,7 +190,7 @@ export default {
check: false, check: false,
agreement: {}, agreement: {},
country_code:'', country_code:'',
showInvite_code: true,
hideImg: false hideImg: false
}; };

46
pages/safe/forget-password.vue

@ -21,6 +21,15 @@
<v-input type="password" v-model="form.password_confirmation" :placeholder="$t('safe.b6')"></v-input> <v-input type="password" v-model="form.password_confirmation" :placeholder="$t('safe.b6')"></v-input>
</view> </view>
</view> </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')">
<template #right>
<img :src="Graph_che" @click="gett_gc_code" v-if="!hideImg">
</template>
</v-input>
</view>
<view class="form-item border-b p-md" v-if="checkData.phone_status==1&&show"> <view class="form-item border-b p-md" v-if="checkData.phone_status==1&&show">
<view class="label m-b-xs">SMS{{$t('safe.a7')}}</view> <view class="label m-b-xs">SMS{{$t('safe.a7')}}</view>
<view class="input color-light"> <view class="input color-light">
@ -60,6 +69,7 @@
</template> </template>
<script> <script>
import Setting from "@/api/setting"; import Setting from "@/api/setting";
import Member from "@/api/member";
export default { export default {
data() { data() {
return { return {
@ -71,9 +81,13 @@ export default {
google_code: "", google_code: "",
password: "", password: "",
password_confirmation: "", password_confirmation: "",
show:false show:false,
gr_code: ''
}, },
checkData: {}, checkData: {},
Graph_che:'',
gc_key:'', // tuxiangyanzheng key
hideImg: false
}; };
}, },
computed: { computed: {
@ -116,11 +130,35 @@ export default {
return return
} }
Setting.forgetPassword(this.form, { btn: this.$refs.btn }) Setting.forgetPassword(this.form, { btn: this.$refs.btn })
.then(() => { .then((res) => {
this.$back(); if(res.code==200){
this.$back();
}else{
this.reGetGraphChe();
}
}) })
.catch(() => {}); .catch(() => {
this.reGetGraphChe();
});
}, },
//
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;
});
}
},
mounted() {
this.gett_gc_code();
}, },
}; };
</script> </script>

Loading…
Cancel
Save