<template>
|
<div class="changePassword">
|
<assets-head :title="$t('修改登录密码')" />
|
<div class="line"></div>
|
<div class="content">
|
<ExInput :label="$t('新密码')" :placeholderText="$t('请输入密码')" :tips="$t('请输入6-12个字符,包括数字或字母')"
|
v-model="newPassword" typeText="password" />
|
<ExInput :label="$t('确认新密码')" :placeholderText="$t('请输入密码')" :tips="$t('请输入6-12个字符,包括数字或字母')"
|
v-model="rePassword" typeText="password" />
|
<button :disabled="!hightLight" class="btn" @click="submit" :class="hightLight ? 'hightLight' : ''">{{
|
$t('确定')
|
}}</button>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import assetsHead from "@/components/assets-head";
|
import ExInput from "@/components/ex-input";
|
import Axios from "@/API/userCenter.js";
|
export default {
|
props: {
|
|
},
|
components: {
|
assetsHead,
|
ExInput,
|
},
|
data() {
|
return {
|
newPassword: '',
|
rePassword: '',
|
type: '',
|
username: '',
|
verifcode: '',
|
account: ''
|
}
|
},
|
computed: {
|
hightLight() {
|
if (this.newPassword.length >= 6 && this.rePassword.length >= 6) {
|
return true
|
} else {
|
return false
|
}
|
}
|
},
|
mounted() {
|
this.type = this.$route.query.type;
|
this.username = this.$route.query.username;
|
this.account = this.$route.query.account;
|
this.verifcode = this.$route.query.verifycode;
|
console.log(this.verifcode)
|
},
|
methods: {
|
submit() {
|
if (this.newPassword !== this.rePassword) {
|
this.$toast(this.$t('密码不一致'));
|
return false
|
}
|
Axios.resetpsw({
|
username: this.type == 1 ? this.account : this.username,
|
password: this.newPassword,
|
verifcode_type: this.type,
|
verifcode: this.verifcode,
|
}).then((res) => {
|
this.$router.push('/passSuccess')
|
}).catch((error) => {
|
if (error.code === 'ECONNABORTED') { this.$toast(this.$t('网络超时!')); }
|
else if (error.msg !== undefined) { this.$toast(this.$t(error.msg)); }
|
});
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss" scoped>
|
.changePassword {
|
width: 100%;
|
box-sizing: border-box;
|
}
|
|
.line {
|
width: 100%;
|
height: 2px;
|
|
@include themify() {
|
background: themed("tab_background");
|
}
|
}
|
|
.content {
|
padding: 32px;
|
font-size: 26px;
|
}
|
|
.btn {
|
@include themify() {
|
background: themed("bg_dark");
|
}
|
|
color: #C0C4CC;
|
height: 88px;
|
line-height: 88px;
|
text-align: center;
|
font-size: 32px;
|
margin-top: 44px;
|
border-radius: 10px;
|
width: 100%;
|
border: none;
|
}
|
|
.hightLight {
|
@include themify() {
|
background: themed("btn_main");
|
}
|
|
color: #fff;
|
}
|
</style>
|