|
@@ -1,63 +1,48 @@
|
|
|
<template>
|
|
|
- <div id="auth">
|
|
|
- <div class="container">
|
|
|
- <div class="top">
|
|
|
- <div class="header">
|
|
|
- <a href="/">
|
|
|
- <img src="~@/assets/logo.svg" class="logo" alt="logo">
|
|
|
- <span class="title">Ant Design</span>
|
|
|
- </a>
|
|
|
- </div>
|
|
|
- <div class="desc">
|
|
|
- Ant Design 是西湖区最具影响力的 Web 设计规范
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="main">
|
|
|
- <a-form ref="formLogin" :autoFormCreate="(form)=>{this.form = form}" id="formLogin">
|
|
|
-
|
|
|
- <a-tabs
|
|
|
- :activeKey="customActiveKey"
|
|
|
- :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
|
|
|
- @change="handleTabClick">
|
|
|
- <a-tab-pane key="tab1" tab="账号密码登陆">
|
|
|
-
|
|
|
- <a-form-item
|
|
|
- fieldDecoratorId="username"
|
|
|
- :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入帐户名或邮箱地址' }, { validator: this.handleUsernameOrEmail }], validateTrigger: 'blur'}"
|
|
|
- >
|
|
|
- <a-input size="large" type="text" v-model="formLogin.username" placeholder="帐户名或邮箱地址 / admin">
|
|
|
- <a-icon slot="prefix" type='user' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
-
|
|
|
- <a-form-item
|
|
|
- fieldDecoratorId="password"
|
|
|
- :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur'}">
|
|
|
- <a-input size="large" type="password" v-model="formLogin.password" placeholder="密码 / admin">
|
|
|
- <a-icon slot="prefix" type='lock' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
- </a-tab-pane>
|
|
|
- <a-tab-pane key="tab2" tab="手机号登陆">
|
|
|
- <a-form-item
|
|
|
- fieldDecoratorId="mobile"
|
|
|
- :fieldDecoratorOptions="{rules: [{ required: true, pattern: /^1[34578]\d{9}$/, message: '请输入正确的手机号' }], validateTrigger: 'blur'}">
|
|
|
- <a-input size="large" type="text" v-model="formLogin.mobile" placeholder="手机号">
|
|
|
- <a-icon slot="prefix" type='mobile' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
-
|
|
|
- <a-row :gutter="16">
|
|
|
- <a-col class="gutter-row" :span="16">
|
|
|
- <a-form-item
|
|
|
- fieldDecoratorId="captcha"
|
|
|
- :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}">
|
|
|
- <a-input size="large" type="text" v-model="formLogin.captcha" placeholder="验证码">
|
|
|
- <a-icon slot="prefix" type='mail' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
- </a-input>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col class="gutter-row" :span="8">
|
|
|
+ <a-form class="user-layout-login" ref="formLogin" :autoFormCreate="(form)=>{this.form = form}" id="formLogin">
|
|
|
+ <a-tabs
|
|
|
+ :activeKey="customActiveKey"
|
|
|
+ :tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
|
|
|
+ @change="handleTabClick">
|
|
|
+ <a-tab-pane key="tab1" tab="账号密码登陆">
|
|
|
+
|
|
|
+ <a-form-item
|
|
|
+ fieldDecoratorId="username"
|
|
|
+ :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入帐户名或邮箱地址' }, { validator: this.handleUsernameOrEmail }], validateTrigger: 'blur'}"
|
|
|
+ >
|
|
|
+ <a-input size="large" type="text" v-model="formLogin.username" placeholder="帐户名或邮箱地址 / admin">
|
|
|
+ <a-icon slot="prefix" type='user' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item
|
|
|
+ fieldDecoratorId="password"
|
|
|
+ :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur'}">
|
|
|
+ <a-input size="large" type="password" v-model="formLogin.password" placeholder="密码 / admin">
|
|
|
+ <a-icon slot="prefix" type='lock' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-tab-pane>
|
|
|
+ <a-tab-pane key="tab2" tab="手机号登陆">
|
|
|
+ <a-form-item
|
|
|
+ fieldDecoratorId="mobile"
|
|
|
+ :fieldDecoratorOptions="{rules: [{ required: true, pattern: /^1[34578]\d{9}$/, message: '请输入正确的手机号' }], validateTrigger: 'blur'}">
|
|
|
+ <a-input size="large" type="text" v-model="formLogin.mobile" placeholder="手机号">
|
|
|
+ <a-icon slot="prefix" type='mobile' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-row :gutter="16">
|
|
|
+ <a-col class="gutter-row" :span="16">
|
|
|
+ <a-form-item
|
|
|
+ fieldDecoratorId="captcha"
|
|
|
+ :fieldDecoratorOptions="{rules: [{ required: true, message: '请输入验证码' }], validateTrigger: 'blur'}">
|
|
|
+ <a-input size="large" type="text" v-model="formLogin.captcha" placeholder="验证码">
|
|
|
+ <a-icon slot="prefix" type='mail' :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
|
+ </a-input>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col class="gutter-row" :span="8">
|
|
|
<span class="ivu-input-prefix">
|
|
|
<a-button
|
|
|
class="getCaptcha"
|
|
@@ -65,53 +50,49 @@
|
|
|
@click.stop.prevent="getCaptcha"
|
|
|
v-text="!state.smsSendBtn&&'获取验证码'||(state.time+' s')"></a-button>
|
|
|
</span>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
-
|
|
|
- </a-tab-pane>
|
|
|
- </a-tabs>
|
|
|
-
|
|
|
- <a-form-item>
|
|
|
- <a-checkbox v-model="formLogin.rememberMe">自动登陆</a-checkbox>
|
|
|
- <router-link :to="{ name: 'recover', params: { user: 'aaa'} }" class="forge-password" style="float: right;">
|
|
|
- 忘记密码
|
|
|
- </router-link>
|
|
|
- </a-form-item>
|
|
|
-
|
|
|
- <a-form-item style="margin-top:24px">
|
|
|
- <a-button
|
|
|
- size="large"
|
|
|
- type="primary"
|
|
|
- htmlType="submit"
|
|
|
- class="login-button"
|
|
|
- :loading="loginBtn"
|
|
|
- @click.stop.prevent="handleSubmit"
|
|
|
- :disabled="loginBtn">确定
|
|
|
- </a-button>
|
|
|
- </a-form-item>
|
|
|
-
|
|
|
- </a-form>
|
|
|
- </div>
|
|
|
- <div class="footer">
|
|
|
- <div class="links">
|
|
|
- <a href="_self">帮助</a>
|
|
|
- <a href="_self">隐私</a>
|
|
|
- <a href="_self">条款</a>
|
|
|
- </div>
|
|
|
- <div class="copyright">
|
|
|
- Copyright © 2018 白鹭学园技术组出品
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+
|
|
|
+ </a-tab-pane>
|
|
|
+ </a-tabs>
|
|
|
+
|
|
|
+ <a-form-item>
|
|
|
+ <a-checkbox v-model="formLogin.rememberMe">自动登陆</a-checkbox>
|
|
|
+ <router-link :to="{ name: 'recover', params: { user: 'aaa'} }" class="forge-password" style="float: right;">
|
|
|
+ 忘记密码
|
|
|
+ </router-link>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <a-form-item style="margin-top:24px">
|
|
|
+ <a-button
|
|
|
+ size="large"
|
|
|
+ type="primary"
|
|
|
+ htmlType="submit"
|
|
|
+ class="login-button"
|
|
|
+ :loading="loginBtn"
|
|
|
+ @click.stop.prevent="handleSubmit"
|
|
|
+ :disabled="loginBtn">确定
|
|
|
+ </a-button>
|
|
|
+ </a-form-item>
|
|
|
+
|
|
|
+ <div class="user-login-other">
|
|
|
+ <span>其他登陆方式</span>
|
|
|
+ <a><a-icon class="item-icon" type="alipay-circle"></a-icon></a>
|
|
|
+ <a><a-icon class="item-icon" type="taobao-circle"></a-icon></a>
|
|
|
+ <a><a-icon class="item-icon" type="weibo-circle"></a-icon></a>
|
|
|
+ <router-link class="register" :to="{ name: 'register' }">
|
|
|
+ 注册账户
|
|
|
+ </router-link>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+
|
|
|
+ </a-form>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import md5 from "md5"
|
|
|
- import api from '../api/'
|
|
|
+ import api from '@/api/'
|
|
|
import { mapActions } from "vuex"
|
|
|
-
|
|
|
- import { timeFix } from "../utils/util"
|
|
|
+ import { timeFix } from "@/utils/util"
|
|
|
|
|
|
export default {
|
|
|
data () {
|
|
@@ -253,116 +234,54 @@
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
- #auth {
|
|
|
- height: 100%;
|
|
|
+ .user-layout-login {
|
|
|
+ label {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
|
|
|
- .container {
|
|
|
+/* .ivu-input-prefix {
|
|
|
+ left: 12px;
|
|
|
+ font-size: 14px;
|
|
|
+ color: rgba(0, 0, 0, 0.25);
|
|
|
+ }*/
|
|
|
+ .getCaptcha {
|
|
|
+ display: block;
|
|
|
width: 100%;
|
|
|
- min-height: 100%;
|
|
|
- background: #f0f2f5 url(~@/assets/background.svg) no-repeat 50%;
|
|
|
- background-size: 100%;
|
|
|
- padding: 110px 0 144px;
|
|
|
- position: relative;
|
|
|
-
|
|
|
- a {
|
|
|
- text-decoration: none;
|
|
|
- }
|
|
|
-
|
|
|
- .top {
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- .header {
|
|
|
- height: 44px;
|
|
|
- line-height: 44px;
|
|
|
-
|
|
|
- .badge {
|
|
|
- position: absolute;
|
|
|
- display: inline-block;
|
|
|
- line-height: 1;
|
|
|
- vertical-align: middle;
|
|
|
- margin-left: -12px;
|
|
|
- margin-top: -10px;
|
|
|
- opacity: 0.8;
|
|
|
- }
|
|
|
-
|
|
|
- .logo {
|
|
|
- height: 44px;
|
|
|
- vertical-align: top;
|
|
|
- margin-right: 16px;
|
|
|
- border-style: none;
|
|
|
- }
|
|
|
-
|
|
|
- .title {
|
|
|
- font-size: 33px;
|
|
|
- color: rgba(0, 0, 0, .85);
|
|
|
- font-family: "Chinese Quote", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
|
|
|
- font-weight: 600;
|
|
|
- position: relative;
|
|
|
- top: 2px;
|
|
|
- }
|
|
|
- }
|
|
|
- .desc {
|
|
|
- font-size: 14px;
|
|
|
- color: rgba(0, 0, 0, 0.45);
|
|
|
- margin-top: 12px;
|
|
|
- margin-bottom: 40px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .main {
|
|
|
- width: 368px;
|
|
|
- margin: 0 auto;
|
|
|
-
|
|
|
- label {
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
+ height: 40px;
|
|
|
+ }
|
|
|
|
|
|
- .ivu-input-prefix {
|
|
|
- left: 12px;
|
|
|
- font-size: 14px;
|
|
|
- color: rgba(0, 0, 0, 0.25);
|
|
|
- }
|
|
|
- .getCaptcha {
|
|
|
- display: block;
|
|
|
- width: 100%;
|
|
|
- height: 40px;
|
|
|
- }
|
|
|
+ .forge-password {
|
|
|
+ font-size: 14px;
|
|
|
+ }
|
|
|
+ button.login-button {
|
|
|
+ padding: 0 15px;
|
|
|
+ font-size: 16px;
|
|
|
+ height: 40px;
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
|
|
|
- .forge-password {
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
- button.login-button {
|
|
|
- padding: 0 15px;
|
|
|
- font-size: 16px;
|
|
|
- height: 40px;
|
|
|
- width: 100%;
|
|
|
+ .user-login-other {
|
|
|
+ text-align: left;
|
|
|
+ margin-top: 24px;
|
|
|
+ line-height: 22px;
|
|
|
+
|
|
|
+ .item-icon {
|
|
|
+ font-size: 24px;
|
|
|
+ color: rgba(0,0,0,.2);
|
|
|
+ margin-left: 16px;
|
|
|
+ vertical-align: middle;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: color .3s;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ color: #1890ff;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .footer {
|
|
|
- position: absolute;
|
|
|
- width: 100%;
|
|
|
- bottom: 0;
|
|
|
- padding: 0 16px;
|
|
|
- margin: 48px 0 24px;
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- .links {
|
|
|
- margin-bottom: 8px;
|
|
|
- font-size: 14px;
|
|
|
- a {
|
|
|
- color: rgba(0, 0, 0, 0.45);
|
|
|
- transition: all 0.3s;
|
|
|
- &:not(:last-child) {
|
|
|
- margin-right: 40px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- .copyright {
|
|
|
- color: rgba(0, 0, 0, 0.45);
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
+ .register {
|
|
|
+ float: right;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
</style>
|