|
|
@ -29,6 +29,11 @@ |
|
|
<el-input v-model="user.password_confirmation" type="password" data-type="repassword" show-password required :placeholder="$t('login.confirm-password')" ></el-input> |
|
|
<el-input v-model="user.password_confirmation" type="password" data-type="repassword" show-password required :placeholder="$t('login.confirm-password')" ></el-input> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 图形验证码 --> |
|
|
|
|
|
<div class="input-group mb-3"> |
|
|
|
|
|
<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="input-group mb-3" v-if="user.google_status"> |
|
|
<div class="input-group mb-3" v-if="user.google_status"> |
|
|
<input type="text" v-model="codes.google_code" class="form-control" required pattern="\d{6}" data-message="code needs 6 number" :placeholder="$t('login.google-code')" /> |
|
|
<input type="text" v-model="codes.google_code" class="form-control" required pattern="\d{6}" data-message="code needs 6 number" :placeholder="$t('login.google-code')" /> |
|
|
</div> |
|
|
</div> |
|
|
@ -46,12 +51,13 @@ |
|
|
<get-code class="btn get-code btn-outline-primary" :data="{country_code:user.country_code, phone:user.phone}" :type="6" /> |
|
|
<get-code class="btn get-code btn-outline-primary" :data="{country_code:user.country_code, phone:user.phone}" :type="6" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<button type="submit" class="btn btn-primary rounded-pill" @click.prevent="step2">{{$t("login.submit")}}</button> |
|
|
<button type="submit" class="btn btn-primary rounded-pill" @click.prevent="step2">{{$t("login.submit")}}</button> |
|
|
</template> |
|
|
</template> |
|
|
</form> |
|
|
</form> |
|
|
|
|
|
|
|
|
<h2>Remembered your password? |
|
|
<h2>{{$t("login.Remembered")}} |
|
|
<router-link to="/sign-in">Log In</router-link> |
|
|
<router-link to="/sign-in">{{$t("common.sign_in")}}</router-link> |
|
|
</h2> |
|
|
</h2> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
@ -69,12 +75,15 @@ export default { |
|
|
account: "", |
|
|
account: "", |
|
|
password : "", |
|
|
password : "", |
|
|
password_confirmation : "", |
|
|
password_confirmation : "", |
|
|
|
|
|
gc_code: '', |
|
|
|
|
|
gc_key: '' |
|
|
}, |
|
|
}, |
|
|
codes : { |
|
|
codes : { |
|
|
google_code : '', |
|
|
google_code : '', |
|
|
email_code : '', |
|
|
email_code : '', |
|
|
sms_code : '' |
|
|
sms_code : '' |
|
|
} |
|
|
}, |
|
|
|
|
|
Graph_che: '' |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -95,6 +104,7 @@ export default { |
|
|
step2() { |
|
|
step2() { |
|
|
if (utils.validate(".chk-body")) { |
|
|
if (utils.validate(".chk-body")) { |
|
|
Member.forgetPwdSumit(Object.assign(this.user, this.codes)).then(dta => { |
|
|
Member.forgetPwdSumit(Object.assign(this.user, this.codes)).then(dta => { |
|
|
|
|
|
console.log(dta, '121323') |
|
|
this.$message({ |
|
|
this.$message({ |
|
|
type : "success", |
|
|
type : "success", |
|
|
message : "修改密码成功,正在跳转到登录页", |
|
|
message : "修改密码成功,正在跳转到登录页", |
|
|
@ -104,9 +114,30 @@ export default { |
|
|
this.$router.push("/sign-in"); |
|
|
this.$router.push("/sign-in"); |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}).catch(err => {}) |
|
|
}).catch(err => { |
|
|
|
|
|
this.gett_gc_code(); |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
|
|
|
// get gc code from api |
|
|
|
|
|
gett_gc_code(){ |
|
|
|
|
|
Member.sendGCode().then( (res) =>{ |
|
|
|
|
|
this.gc_key = res.key |
|
|
|
|
|
this.Graph_che = res.img |
|
|
|
|
|
console.log("gc",res); |
|
|
|
|
|
this.$message({ |
|
|
|
|
|
message: `${type} ${this.$t("login.sendOK")}`, |
|
|
|
|
|
type: "success", |
|
|
|
|
|
duration : 2000, |
|
|
|
|
|
}); |
|
|
|
|
|
}).catch( err =>{ |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
|
|
|
mounted(){ |
|
|
|
|
|
// bind get gc code |
|
|
|
|
|
this.gett_gc_code(); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
</script> |
|
|
</script> |
|
|
|