Browse Source

修改密码时候输入验证码

master
xyiege 2 years ago
parent
commit
c6bf1daf00
  1. 27
      src/views/setting/login-pwd.vue

27
src/views/setting/login-pwd.vue

@ -20,6 +20,13 @@
:placeholder="$t('setting.pleaseConfirmPassword')"
/>
</div>
<!-- Captcha -->
<div class="form-group">
<label>{{$t('common.GraphicValidation')}}</label>
<input type="text" id="gccode" v-model="user.gc_code" required
:placeholder="$t('common.GraphicValidation')" class="form-control col-6" />
<img class="col-6" :src="Graph_che" @click="gett_gc_code">
</div>
<div class="form-group" v-if="detail.phone_status==1">
<label>{{$t('setting.smsVer')}}</label>
<div class="input-group mb-3">
@ -70,7 +77,9 @@
</template>
<script>
import Member from "@/api/member";
import Setting from "../../api/setting";
export default {
props: ["detail"],
data() {
@ -81,10 +90,26 @@ export default {
sms_code: "",
email_code: "",
google_code: ""
}
},
Graph_che:'', // gc code image
gc_key:'', // tuxiangyanzheng key
};
},
methods: {
// get gc code from api
gett_gc_code(){
Member.sendGCode().then( (res) =>{
this.gc_key = res.key
this.Graph_che = res.img
this.$message({
message: `${type} ${this.$t("login.sendOK")}`,
type: "success",
duration : 2000,
});
}).catch( err =>{
//console.log(err)
});
},
setPassword() {
let data = this.form;
if (utils.validate(".edit-password")) {

Loading…
Cancel
Save