Commit 8520bbeb authored by zhangyanni's avatar zhangyanni

找回密码

parent d7ad45f6
......@@ -3,11 +3,11 @@
<p>找回密码</p>
<el-form :model="ruleForm" :rules="rules" ref="ruleForm"
class="demo-loginForm">
<el-form-item prop="email" required>
<el-input v-model="ruleForm.email" placeholder="请输入手机号或邮箱" autocomplete></el-input>
<el-form-item prop="email">
<el-input v-model.trim="ruleForm.email" :placeholder="lang==1?'请输入手机号':'请输入邮箱'" autocomplete></el-input>
</el-form-item>
<el-form-item prop="code" class="yzcodeItem" required>
<el-input type="text" v-model="ruleForm.code" placeholder="请输入手机/邮箱验证码" style="float: left;"
<el-input type="text" v-model.trim="ruleForm.code" :placeholder="lang==1?'请输入手机验证码':'请输入邮箱验证码'" style="float: left;"
autocomplete></el-input>
<!--<span class="getyzcodeBtn">{{codehtml}}</span>-->
<span class="getdyzcodeBtn" @click="handleGetCode">{{codehtml}}</span>
......@@ -24,9 +24,12 @@
</template>
<script>
import validate from '../../common/validate';
import publicFunc from '../../common/public';
export default {
name: "findPasswordCmpt",
data(){
const that = this;
return{
codehtml: "获取验证码",
lang:window.localStorage.getItem("lang")=="zh-CN"?1:2,
......@@ -34,24 +37,31 @@
email:"",
code:""
},
validateWhich:null,
rules:{
email: [
{required: true, message: '请输入手机号', trigger: 'blur'},
{max: 11, message: '长度在 11 个字符', trigger: 'blur'}
{required: false, validator:window.localStorage.getItem("lang")=="zh-CN"?validate.checkMobile:validate.checkEmail, trigger: 'blur'}
],
pass:[
{required: true, message: '请输入密码', trigger: 'blur'},
{min:6,max: 18, message: '长度在 6 到 18 个字符', trigger: 'blur'}
{required: true, validator:validate.checkPassWord, trigger: 'blur'},
{min:6,max: 18, message: '密码长度在 6 到 18 个字符', trigger: 'blur'}
],
code: [{required: true, message: '请输入验证码', trigger: 'blur'},
{max: 4, message: '长度在 4 个字符', trigger: 'blur'}]
code: [{required: true, validator:validate.checkCode, trigger: 'blur'},
{min:4,max: 6, message: '长度在 4 到 6 个字符', trigger: 'blur'}]
}
}
},
methods:{
//确认
handleSubmit(formName){
this.$router.replace("/modifyPasswordCmpt")
const that = this;
this.$refs[formName].validate((valid) => {
if (valid) {
that.$router.replace("/modifyPasswordCmpt")
} else {
return false;
}
});
},
//获取验证码
......@@ -66,7 +76,6 @@
}
},
mounted(){
}
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment