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')" :placeholder="$t('setting.pleaseConfirmPassword')"
/> />
</div> </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"> <div class="form-group" v-if="detail.phone_status==1">
<label>{{$t('setting.smsVer')}}</label> <label>{{$t('setting.smsVer')}}</label>
<div class="input-group mb-3"> <div class="input-group mb-3">
@ -70,7 +77,9 @@
</template> </template>
<script> <script>
import Member from "@/api/member";
import Setting from "../../api/setting"; import Setting from "../../api/setting";
export default { export default {
props: ["detail"], props: ["detail"],
data() { data() {
@ -81,10 +90,26 @@ export default {
sms_code: "", sms_code: "",
email_code: "", email_code: "",
google_code: "" google_code: ""
} },
Graph_che:'', // gc code image
gc_key:'', // tuxiangyanzheng key
}; };
}, },
methods: { 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() { setPassword() {
let data = this.form; let data = this.form;
if (utils.validate(".edit-password")) { if (utils.validate(".edit-password")) {

Loading…
Cancel
Save