Browse Source

修改

master
453530270@qq.com 3 years ago
parent
commit
bf12bb54d8
  1. 48
      pages/safe/forget-password.vue
  2. 53
      pages/safe/login-password.vue

48
pages/safe/forget-password.vue

@ -6,7 +6,7 @@
<view class="form-item border-b p-md"> <view class="form-item border-b p-md">
<view class="label m-b-xs">{{$t('safe.b1')}}</view> <view class="label m-b-xs">{{$t('safe.b1')}}</view>
<view class="input color-light"> <view class="input color-light">
<v-input v-model="form.account" :placeholder="`${$t('safe.b2')}`" @blur="checkAccount"></v-input> <v-input v-model="form.account" :placeholder="`${$t('safe.a4')}`" @blur="checkAccount"></v-input>
</view> </view>
</view> </view>
<view class="form-item border-b p-md"> <view class="form-item border-b p-md">
@ -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>

53
pages/safe/login-password.vue

@ -2,6 +2,12 @@
<v-page class="pos-login"> <v-page class="pos-login">
<v-header :title="$t('safe.c8')"></v-header> <v-header :title="$t('safe.c8')"></v-header>
<main class=" m-x-xl bg-panel-3 p-x-lg p-y-lg rounded-md box-shadow"> <main class=" m-x-xl bg-panel-3 p-x-lg p-y-lg rounded-md box-shadow">
<view class="form-item border-b p-md">
<view class="label m-b-xs">{{$t('safe.b1')}}</view>
<view class="input color-light">
<v-input v-model="form.account" :placeholder="`${$t('safe.a4')}`" @blur="checkAccount"></v-input>
</view>
</view>
<view class="form-item border-b p-md "> <view class="form-item border-b p-md ">
<view class="label m-b-xs">{{$t('safe.b3')}}</view> <view class="label m-b-xs">{{$t('safe.b3')}}</view>
<view class="input color-light"> <view class="input color-light">
@ -14,6 +20,16 @@
<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="user.phone_status==1"> <view class="form-item border-b p-md" v-if="user.phone_status==1">
<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">
@ -50,6 +66,7 @@
</v-page> </v-page>
</template> </template>
<script> <script>
import Member from "@/api/member";
import { mapState } from "vuex"; import { mapState } from "vuex";
import Setting from "@/api/setting"; import Setting from "@/api/setting";
export default { export default {
@ -62,6 +79,8 @@ export default {
email_code: "", email_code: "",
google_code: "", google_code: "",
}, },
Graph_che:'',
gc_key:'', // tuxiangyanzheng key
}; };
}, },
computed: { computed: {
@ -69,7 +88,41 @@ export default {
user: "user", user: "user",
}), }),
}, },
mounted() {
this.gett_gc_code();
},
methods: { methods: {
checkAccount(){
},
//ȡͼ֤
refreshCaptcha() {
axios.get('/register/Graph_che')
.then(response => {
// ¼֤ͼƬ
})
.catch(error => {
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;
});
//this.Graph_che = gc
},
setPassword() { setPassword() {
let data = this.form; let data = this.form;
Setting.updatePassword(data, { btn: this.$refs.btn }) Setting.updatePassword(data, { btn: this.$refs.btn })

Loading…
Cancel
Save