-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
340 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,118 @@ | ||
<template> | ||
<div> | ||
<div class="input-div one"> | ||
<div class="i"> | ||
<i class="fas fa-user"></i> | ||
</div> | ||
<div class="div"> | ||
<input type="text" class="input" placeholder="邮箱"> | ||
</div> | ||
<div style="width: 80%px; height: 50%; background-color: white; border-radius: 10px; | ||
margin:auto; padding:50px"> | ||
<div style="margin: 30px; text-align: center; font-size: 30px; font-weight: bold; color: dodgerblue">登 录</div> | ||
<el-form :model="admin" :rules="rules" ref="loginForm"> | ||
<el-form-item prop="username"> | ||
<el-input placeholder="请输入账号" prefix-icon="el-icon-user" size="medium" | ||
v-model="admin.username"></el-input> | ||
</el-form-item> | ||
<el-form-item prop="email"> | ||
<el-input placeholder="请输入邮箱" show-password prefix-icon="el-icon-lock" size="medium" | ||
v-model="admin.email"></el-input> | ||
</el-form-item> | ||
<el-form-item prop="password"> | ||
<el-input placeholder="请输入新密码" show-password prefix-icon="el-icon-lock" size="medium" | ||
v-model="admin.email" @keypress.enter.native="login"></el-input> | ||
</el-form-item> | ||
<el-form-item prop="password"> | ||
<el-input placeholder="请再次输入密码" show-password prefix-icon="el-icon-lock" size="medium" | ||
v-model="admin.email" @keypress.enter.native="login"></el-input> | ||
</el-form-item> | ||
<el-form-item prop="验证码"> | ||
<el-input placeholder="请输入验证码" show-password prefix-icon="el-icon-lock" size="medium" | ||
v-model="admin.email" @keypress.enter.native="login"></el-input> | ||
</el-form-item> | ||
<el-form-item> | ||
<el-button style="width: 100%" size="medium" type="primary" @click="login" class="btn">更新</el-button> | ||
</el-form-item> | ||
</el-form> | ||
</div> | ||
<div class="input-div pass"> | ||
<div class="i"> | ||
<i class="fas fa-lock"></i> | ||
</div> | ||
<div class="div"> | ||
<input type="password" class="input" placeholder="新密码"> | ||
</div> | ||
</div> | ||
<div class="input-div verification"> | ||
<div class="i"> | ||
<i class="fas fa-lock"></i> | ||
</div> | ||
<div class="div"> | ||
<input type="verif" class="input" placeholder="验证码"> | ||
</div> | ||
</div> | ||
<input type="submit" class="btn" value="验证" /> | ||
</div> | ||
<!-- <el-popconfirm title="确定重置为1234?" @confirm="handleResetPass(scope.row.id)"> | ||
<el-button type="warning" slot="reference" size="mini">重置</el-button> | ||
</el-popconfirm> --> | ||
</template> | ||
|
||
<script lang="ts"> | ||
<script> | ||
import request from "@/utils/request"; | ||
import Cookies from 'js-cookie' | ||
export default { | ||
name: "ForgetThePassword", | ||
components: {}, | ||
data() { | ||
return { | ||
loginAdmin: {}, | ||
admin: {}, | ||
rules: { | ||
username: [ | ||
{ required: true, message: '请输入用户名', trigger: 'blur' }, | ||
{ min: 3, max: 10, message: '长度在3-10个字符', trigger: 'blur' } | ||
], | ||
password: [ | ||
{ required: true, message: '请输入密码', trigger: 'blur' }, | ||
{ min: 3, max: 10, message: '长度在3-10个字符', trigger: 'blur' } | ||
] | ||
} | ||
} | ||
}, | ||
methods: { | ||
login() { | ||
this.$refs['loginForm'].validate((valid) => { | ||
if (valid) { | ||
// request.post('/admin/login', this.admin).then(res => { | ||
// if (res.code === '200') { | ||
// this.loginAdmin = res.data | ||
// this.$notify.success("登录成功") | ||
// Cookies.set('admin', JSON.stringify(this.loginAdmin)) | ||
// this.$router.push('/') | ||
// } else { | ||
// this.$notify.error(res.msg) | ||
// } | ||
// }) | ||
} | ||
}) | ||
}, | ||
handleResetPass(id) { | ||
request.put("/admin/resetPass/" + id).then(res => { | ||
if (res.code === '200') { | ||
this.$notify.success('重置成功') | ||
// 重置的当前用户id | ||
if (this.form.id === this.admin.id) { | ||
Cookies.remove('admin') | ||
this.$router.push('/login') | ||
} | ||
this.load() | ||
} else { | ||
this.$notify.error(res.msg) | ||
} | ||
}) | ||
}, | ||
} | ||
}; | ||
</script> | ||
<style scoped></style> | ||
<style> | ||
.btn { | ||
display: block; | ||
width: 100%; | ||
height: 50px; | ||
border-radius: 25px; | ||
outline: none; | ||
border: none; | ||
background-image: linear-gradient(to right, #32be8f, #38d39f, #32be8f); | ||
background-size: 200%; | ||
font-size: 1.2rem; | ||
color: #fff; | ||
font-family: 'Poppins', sans-serif; | ||
text-transform: uppercase; | ||
margin: 1rem 0; | ||
cursor: pointer; | ||
transition: .5s; | ||
} | ||
.btn:hover { | ||
background-position: right; | ||
} | ||
</style> |
Oops, something went wrong.