|
|
@ -13,10 +13,9 @@ |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-input v-model="loginForm.password" autocomplete="off" |
|
|
|
placeholder="请输入密码" prefix-icon="el-icon-lock" show-password> |
|
|
|
<el-input v-model="loginForm.password" autocomplete="off" placeholder="请输入密码" prefix-icon="el-icon-lock" show-password> |
|
|
|
</el-input> |
|
|
|
<span class="nopsw register" @click="forgetPwd = true">忘记密码 ?</span> |
|
|
|
<span class="nopsw register" @click="handleforgetPwd">忘记密码 ?</span> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-show="showMsg" style="margin-bottom:0;"> |
|
|
|
<span class="text-danger">提示:用户名或密码错误,请重试!</span> |
|
|
@ -38,12 +37,12 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-dialog title="忘记密码" :visible.sync="forgetPwd"> |
|
|
|
<el-dialog title="忘记密码" :visible.sync="forgetPwd" :close-on-click-modal="false"> |
|
|
|
<el-form :model="nopassword"> |
|
|
|
<el-form-item label="手机号"> |
|
|
|
<el-input v-model="nopassword.userPhone" autocomplete="off"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="用户名"> |
|
|
|
<el-form-item label="姓名"> |
|
|
|
<el-input v-model="nopassword.userName" autocomplete="off"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
@ -64,7 +63,6 @@ |
|
|
|
import user from '@/api/User/login.js' |
|
|
|
import {setToken, getToken, setSession} from '@/utils/auth' |
|
|
|
import imgCodeRole from '@/components/imgCodeRole/index.vue' |
|
|
|
import qs from 'qs' |
|
|
|
|
|
|
|
export default { |
|
|
|
components: {imgCodeRole}, |
|
|
@ -115,16 +113,35 @@ |
|
|
|
} |
|
|
|
this.$refs.imgCodeRole.getCodeImage() |
|
|
|
}, |
|
|
|
handleforgetPwd() { |
|
|
|
this.forgetPwd = true |
|
|
|
this.nopassword = { |
|
|
|
userPhone: '', |
|
|
|
userName: '' |
|
|
|
} |
|
|
|
}, |
|
|
|
reGetPwd() { |
|
|
|
user.reGetPwd(this.nopassword).then(res => { |
|
|
|
|
|
|
|
if (this.nopassword.userPhone === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '手机号不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.nopassword.userName === '') { |
|
|
|
this.$message({ showClose: true, type: 'error', message: '姓名不能为空' }) |
|
|
|
return |
|
|
|
} |
|
|
|
user.reGetPwd(this.nopassword).then((res) => { |
|
|
|
if (res.success) { |
|
|
|
this.$message({ showClose: true, type: 'success', message: '新密码已发送至手机,请查看短信' }) |
|
|
|
this.forgetPwd = false |
|
|
|
} else { |
|
|
|
this.$message({ showClose: true, type: 'error', message: res.msg }) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss"> |
|
|
|
.login { |
|
|
|
position: relative; |
|
|
|