From f21e3fe4a2a4637be8583bce76477bd51b54cd19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0?= <15071126431@163.com> Date: Wed, 28 Apr 2021 10:22:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=99=BB=E5=BD=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/Sidebar.vue | 3 ++ src/components/page/Login.vue | 59 ++++++++++++++++++++------ src/components/page/PersonalCenter.vue | 1 + 3 files changed, 49 insertions(+), 14 deletions(-) diff --git a/src/components/common/Sidebar.vue b/src/components/common/Sidebar.vue index 0a9e3c2..4e16bf1 100644 --- a/src/components/common/Sidebar.vue +++ b/src/components/common/Sidebar.vue @@ -145,6 +145,9 @@ export default { .sidebar-el-menu:not(.el-menu--collapse) { width: 100%; } +.el-menu.el-menu--horizontal{ + border-bottom: none; +} .sidebar > ul { height: 100%; } diff --git a/src/components/page/Login.vue b/src/components/page/Login.vue index 4a425c3..7160f71 100644 --- a/src/components/page/Login.vue +++ b/src/components/page/Login.vue @@ -9,8 +9,8 @@
- - + + @@ -19,13 +19,13 @@ type="password" placeholder="请输入密码" v-model="param.password" - @keyup.enter.native="submitForm()" + @keyup.enter.native="submitForm('param')" > - 忘记密码? + + + +
@@ -48,23 +67,32 @@ export default { data: function() { return { param: { - username: '', - password: '', + username: 'admin', + password: 'admin' }, rules: { - username: [{ required: true, message: '请输入账号', trigger: 'blur' }], + username: [{ required: true, message: '请输入用户名', trigger: 'blur' }], password: [{ required: true, message: '请输入密码', trigger: 'blur' }], }, - activeName: 'first' + phoneParam: { + userphone: '', + phonePassword: '' + }, + phoneRules: { + userphone: [{ required: true, message: '请输入手机号/邮箱', trigger: 'blur' }], + phonePassword: [{ required: true, message: '请输入密码', trigger: 'blur' }], + }, + activeName: '0' }; }, methods: { - submitForm() { - this.$refs.login.validate(valid => { + submitForm(form) { + this.$refs[form].validate(valid => { if (valid) { let data = { - account: this.param.username, - password: this.param.password + account: this.activeName == '0' ? this.param.username : this.phoneParam.userphone, + password: this.activeName == '0' ? this.param.password : this.phoneParam.phonePassword, + source: this.activeName } this.$get(this.api.logins,data).then(res => { let data = res.message.retvalue @@ -82,6 +110,9 @@ export default { // this.$message.error('该用户没有权限'); // } }).catch(res => {}); + } else { + this.$message.error('请输入账号和密码'); + return false; } }); }, diff --git a/src/components/page/PersonalCenter.vue b/src/components/page/PersonalCenter.vue index 4723f40..cb3aed2 100644 --- a/src/components/page/PersonalCenter.vue +++ b/src/components/page/PersonalCenter.vue @@ -1004,6 +1004,7 @@ export default {