|
@@ -6,15 +6,15 @@
|
|
<h3 class="title">Login Form</h3>
|
|
<h3 class="title">Login Form</h3>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <el-form-item prop="username">
|
|
|
|
|
|
+ <el-form-item prop="account">
|
|
<span class="svg-container">
|
|
<span class="svg-container">
|
|
<svg-icon icon-class="user" />
|
|
<svg-icon icon-class="user" />
|
|
</span>
|
|
</span>
|
|
<el-input
|
|
<el-input
|
|
- ref="username"
|
|
|
|
- v-model="loginForm.username"
|
|
|
|
|
|
+ ref="account"
|
|
|
|
+ v-model="loginForm.account"
|
|
placeholder="Username"
|
|
placeholder="Username"
|
|
- name="username"
|
|
|
|
|
|
+ name="account"
|
|
type="text"
|
|
type="text"
|
|
tabindex="1"
|
|
tabindex="1"
|
|
auto-complete="on"
|
|
auto-complete="on"
|
|
@@ -53,33 +53,17 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { validUsername } from '@/utils/validate'
|
|
|
|
-
|
|
|
|
export default {
|
|
export default {
|
|
name: 'Login',
|
|
name: 'Login',
|
|
data() {
|
|
data() {
|
|
- const validateUsername = (rule, value, callback) => {
|
|
|
|
- if (!validUsername(value)) {
|
|
|
|
- callback(new Error('Please enter the correct user name'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- const validatePassword = (rule, value, callback) => {
|
|
|
|
- if (value.length < 6) {
|
|
|
|
- callback(new Error('The password can not be less than 6 digits'))
|
|
|
|
- } else {
|
|
|
|
- callback()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
return {
|
|
return {
|
|
loginForm: {
|
|
loginForm: {
|
|
- username: 'admin',
|
|
|
|
- password: '111111'
|
|
|
|
|
|
+ account: 'admin',
|
|
|
|
+ password: '123456'
|
|
},
|
|
},
|
|
loginRules: {
|
|
loginRules: {
|
|
- username: [{ required: true, trigger: 'blur', validator: validateUsername }],
|
|
|
|
- password: [{ required: true, trigger: 'blur', validator: validatePassword }]
|
|
|
|
|
|
+ account: [{ required: true, trigger: 'blur' }],
|
|
|
|
+ password: [{ required: true, trigger: 'blur' }]
|
|
},
|
|
},
|
|
loading: false,
|
|
loading: false,
|
|
passwordType: 'password',
|
|
passwordType: 'password',
|