Browse Source

改前

master
luyisha 2 years ago
parent
commit
35d3738667
  1. 8
      api/member.js
  2. 24
      layout/vCode.vue
  3. 77
      pages/reg/index.vue

8
api/member.js

@ -124,14 +124,6 @@ class Member {
static serviceDetail(data) { static serviceDetail(data) {
return server.get(`/article/serviceDetail`, data); return server.get(`/article/serviceDetail`, data);
} }
/**
* 获取图形验证码
* @param data {email,token}
*/
static Graph_che() {
return server.get(`/register/Graph_che`);
}
} }
export default Member; export default Member;

24
layout/vCode.vue

@ -75,24 +75,12 @@ export default {
if (this.load) return; if (this.load) return;
this.inSend = true; this.inSend = true;
serve.post(this.url, this.data) serve.post(this.url, this.data)
// .then(() => { .then(() => {
// 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'));
// }) })
.then((res) => {
// ss
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'));
}
})
.catch(() => { .catch(() => {
this.inSend = false; this.inSend = false;
}); });

77
pages/reg/index.vue

@ -70,41 +70,29 @@
</view> </view>
</template> </template>
</view> </view>
<!--图形验证码-->
<view class="form-item border-b m-b-md p-b-xs">
<view class="label m-b-xs">Captcha</view>
<v-input class="color-light" v-model="form.gr_code" placeholder='Please enter graphic results'>
<template #right>
<!-- 邮箱 -->
<img :src="Graph_che" @click="gett_gc_code">
</template>
</v-input>
</view>
<view class="form-item border-b m-b-md p-b-xs"> <view class="form-item border-b m-b-md p-b-xs">
<view class="label m-b-xs">{{$t('reg.a6')}}</view> <view class="label m-b-xs">{{$t('reg.a6')}}</view>
<v-input class="color-light" v-model="form.code" :placeholder="$t('reg.a7')"> <v-input class="color-light" v-model="form.code" :placeholder="$t('reg.a7')">
<template #right> <template #right>
<!-- 手机 --> <!-- 手机 -->
<v-code <v-code
v-show="form.type==1" v-show="form.type==1"
url="/register/sendSmsCode" url="/register/sendSmsCode"
:data="{ :data="{
phone:form.account, phone:form.account,
country_code:country_code || 86, country_code:country_code || 86,
type:1 type:1
}" }"
></v-code> ></v-code>
<!-- 邮箱 --> <!-- 邮箱 -->
<v-code <v-code
url="/register/sendEmailCode" url="/register/sendEmailCode"
:data="{ :data="{
email:form.account, email:form.account,
gc_code: form.gr_code, type:1
gc_key: gc_key, }"
type:1 v-show="form.type==2"
}" ></v-code>
v-show="form.type==2"
></v-code>
</template> </template>
</v-input> </v-input>
</view> </view>
@ -171,11 +159,7 @@ export default {
password: "", password: "",
password_confirmation: "", password_confirmation: "",
invite_code: "", invite_code: "",
gr_code: "",
}, },
captcha: '',
Graph_che:'',
gc_key:'', // tuxiangyanzheng key
check: false, check: false,
agreement: {}, agreement: {},
country_code:'' country_code:''
@ -246,29 +230,6 @@ export default {
this.$toast(this.$t('reg.c5')); this.$toast(this.$t('reg.c5'));
}); });
}, },
//
refreshCaptcha() {
axios.get('/register/Graph_che')
.then(response => {
//
})
.catch(error => {
console.log(error);
});
},
gett_gc_code(){
Member.Graph_che().then((res)=>{
console.log("gc",res.data.img)
this.Graph_che = res.data.img;
this.gc_key= res.data.key;
});
//this.Graph_che = gc
},
// //
login(){ login(){
let data={type: 2,account:this.form.account,password: this.form.password} let data={type: 2,account:this.form.account,password: this.form.password}
@ -294,7 +255,7 @@ export default {
}, },
}, },
mounted() { mounted() {
this.gett_gc_code();
}, },
onLoad(query){ onLoad(query){
this.query = query this.query = query

Loading…
Cancel
Save