Skip to content

Commit

Permalink
完善,并发布 1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fengwenyi committed Apr 20, 2022
1 parent b02fad5 commit 6899986
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2021 Vue Admin Pro
Copyright (c) 2017-2022 Vue Admin Pro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion LOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## v1.2.0

2021.11.20 ~
2021.11.20 ~ 2022.04.21

* 【新增】登录页支持账号密码和验证码等多种登录方式
* 【升级】view-design -> 4.7.0
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-admin-pro",
"version": "1.2.0-SNAPSHOT",
"version": "1.2.0",
"author": "Erwin.Feng<[email protected]>",
"private": false,
"scripts": {
Expand Down
31 changes: 16 additions & 15 deletions src/view/Login/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
size="large" prefix="md-lock" placeholder="密码"/>
</FormItem>
<FormItem>
<Button class="login-form-btn-submit" @click="handleSubmit('formLogin')" on-enter="handleSubmit"
<Button class="login-form-btn-submit" @click="handleSubmit('formLogin')"
type="primary">登 录
</Button>
</FormItem>
Expand All @@ -52,7 +52,7 @@
<Input type="text" v-model="formEmailLogin.email" class="login-form-input" size="large"
prefix="md-mail" placeholder="邮箱"/>
</FormItem>
<FormItem prop="code">
<FormItem prop="emailCode">
<Row :gutter="16">
<Col span="14">
<Input
Expand All @@ -70,7 +70,7 @@
</Row>
</FormItem>
<FormItem>
<Button class="login-form-btn-submit" @click="handleSubmit('formEmailLogin')" on-enter="handleSubmit"
<Button class="login-form-btn-submit" @click="handleSubmit('formEmailLogin')"
type="primary">登 录
</Button>
</FormItem>
Expand All @@ -79,13 +79,13 @@

<!-- 手机验证码登录 form -->
<section v-if="loginWayCodePhone" class="login-form">
<Form ref="ruleFormPhoneLogin" :model="formPhoneLogin" :rules="ruleFormPhoneLogin"
<Form ref="formPhoneLogin" :model="formPhoneLogin" :rules="ruleFormPhoneLogin"
@keydown.enter.native="handleSubmit('formPhoneLogin')">
<FormItem prop="phone">
<Input type="text" v-model="formPhoneLogin.phone" class="login-form-input" size="large"
prefix="md-phone-portrait" placeholder="手机号"/>
</FormItem>
<FormItem prop="code">
<FormItem prop="phoneCode">
<Row :gutter="16">
<Col span="14">
<Input
Expand All @@ -103,7 +103,7 @@
</Row>
</FormItem>
<FormItem>
<Button class="login-form-btn-submit" @click="handleSubmit('formPhoneLogin')" on-enter="handleSubmit"
<Button class="login-form-btn-submit" @click="handleSubmit('formPhoneLogin')"
type="primary">登 录
</Button>
</FormItem>
Expand All @@ -112,9 +112,9 @@

<section class="box-other-login">
其他登录方式
<Button class="btn-login" shape="circle" icon="md-lock" @click="changeLoginWay(1)"></Button>
<Button class="btn-login" shape="circle" icon="md-mail" @click="changeLoginWay(2)"></Button>
<Button class="btn-login" shape="circle" icon="md-phone-portrait" @click="changeLoginWay(3)"></Button>
<Button class="btn-login" shape="circle" icon="md-lock" @click="changeLoginWay('formLogin')"></Button>
<Button class="btn-login" shape="circle" icon="md-mail" @click="changeLoginWay('formEmailLogin')"></Button>
<Button class="btn-login" shape="circle" icon="md-phone-portrait" @click="changeLoginWay('formPhoneLogin')"></Button>
</section>
</section>

Expand Down Expand Up @@ -166,7 +166,7 @@ export default {
email: [
{ required: true, message: '邮箱不能为空', trigger: 'blur' }
],
code: [
emailCode: [
{ required: true, message: '验证码不能为空', trigger: 'blur' },
{
type: 'string',
Expand All @@ -184,7 +184,7 @@ export default {
phone: [
{ required: true, message: '手机号不能为空', trigger: 'blur' }
],
code: [
phoneCode: [
{ required: true, message: '验证码不能为空', trigger: 'blur' },
{
type: 'string',
Expand All @@ -203,6 +203,7 @@ export default {
methods: {
// 登录
handleSubmit (formName) {
this.$Message.warning(formName)
this.$refs[formName].validate((valid) => {
if (valid) {
let formData = {}
Expand All @@ -220,18 +221,18 @@ export default {
})
},
// 切换登录方式
changeLoginWay (i) {
if (i === 1) {
changeLoginWay (formName) {
if (formName === 'formLogin') {
this.loginWayName = '账号密码登录'
this.loginWayPwd = true
this.loginWayCodeEmail = false
this.loginWayCodePhone = false
} else if (i === 2) {
} else if (formName === 'formEmailLogin') {
this.loginWayName = '邮箱登录'
this.loginWayPwd = false
this.loginWayCodeEmail = true
this.loginWayCodePhone = false
} else if (i === 3) {
} else if (formName === 'formPhoneLogin') {
this.loginWayName = '手机号登录'
this.loginWayPwd = false
this.loginWayCodeEmail = false
Expand Down

0 comments on commit 6899986

Please sign in to comment.