登录页
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 93 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 846 B |
@@ -1,29 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="userLayout" :class="['user-layout-wrapper',device]">
|
<div id="userLayout" :class="['user-layout-wrapper',device]">
|
||||||
<div :class="!mobile ? 'container' : 'container-mobile'">
|
<div class="container">
|
||||||
<div class="top" id="top" v-if="!mobile">
|
<div class="illustration">
|
||||||
<div class="logo">
|
|
||||||
<img id="logo" src="~@/assets/logo.png" alt="">
|
|
||||||
</div>
|
|
||||||
<div id="company">
|
|
||||||
<span id="c-company">合众未来</span>
|
|
||||||
<span id="p-company">HEZHONGWEILAI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div v-if="mobile">
|
|
||||||
<span class="top-bg"><img src="~/@assets/mobileBg.png" alt=""></span>
|
|
||||||
<span class="btm-bg"><img src="~/@assets/mobileHome.png" alt=""></span>
|
|
||||||
</div>
|
|
||||||
<div v-if="mobile" class="mobile">
|
|
||||||
<div class="logo">
|
|
||||||
<img src="~@/assets/logo.png" alt="">
|
|
||||||
</div>
|
|
||||||
<div class="company">
|
|
||||||
<span>合众未来</span>
|
|
||||||
<span>HEZHONGWEILAI</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="illustration" v-if="!mobile">
|
|
||||||
<img src="@/assets/home.png" alt="">
|
<img src="@/assets/home.png" alt="">
|
||||||
</div>
|
</div>
|
||||||
<route-view></route-view>
|
<route-view></route-view>
|
||||||
@@ -77,134 +55,27 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" >
|
<style lang="less" >
|
||||||
#userLayout.user-layout-wrapper{
|
#userLayout.user-layout-wrapper{
|
||||||
|
height: 100%;
|
||||||
|
background: #fff;
|
||||||
|
overflow: auto;
|
||||||
|
.container {
|
||||||
|
width: 100%;
|
||||||
|
min-width: 1366px;
|
||||||
|
min-height: 768px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
background: #4daaff;
|
overflow: hidden;
|
||||||
overflow: auto;
|
position: relative;
|
||||||
.container {
|
|
||||||
width: 100%;
|
|
||||||
min-width: 770px;
|
|
||||||
min-height: 500px;
|
|
||||||
height: 100%;
|
|
||||||
position: relative;
|
|
||||||
.top {
|
|
||||||
position: absolute;
|
|
||||||
left: 2%;
|
|
||||||
top: 3%;
|
|
||||||
min-width: 100px;
|
|
||||||
max-height: 50px;
|
|
||||||
z-index: 9;
|
|
||||||
.logo {
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
position: absolute;
|
|
||||||
overflow: hidden;
|
|
||||||
img {
|
|
||||||
display: block;
|
|
||||||
max-width: 100%;
|
|
||||||
min-height: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#company {
|
|
||||||
position: absolute;
|
|
||||||
max-height: 62px;
|
|
||||||
left: 5.5rem;
|
|
||||||
min-height: 61px;
|
|
||||||
color: #000;
|
|
||||||
white-space: nowrap;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-end;
|
|
||||||
span {
|
|
||||||
display: block;
|
|
||||||
&:first-child {
|
|
||||||
font-size: 1.8rem;
|
|
||||||
font-weight: 700;
|
|
||||||
letter-spacing: 0.3rem;
|
|
||||||
}
|
|
||||||
&:last-child {
|
|
||||||
font-size: 0.9rem;
|
|
||||||
line-height: 0.9rem;
|
|
||||||
letter-spacing: 0.06rem;
|
|
||||||
font-weight: 700;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.illustration{
|
.illustration{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
max-width: 50%;
|
max-height: 100%;
|
||||||
max-height: 100%;
|
|
||||||
height: 100%;
|
|
||||||
min-width: 400px;
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
img{
|
|
||||||
max-width: 70%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.container-mobile{
|
|
||||||
/*移动端的logo样式*/
|
|
||||||
.top-bg{
|
|
||||||
width: 100%;
|
|
||||||
position: absolute;
|
|
||||||
top: -3.5rem;
|
|
||||||
img{
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.btm-bg{
|
|
||||||
position: absolute;
|
|
||||||
bottom: 0;
|
|
||||||
left: 0;
|
|
||||||
max-width: 75%;
|
|
||||||
overflow: hidden;
|
|
||||||
img{
|
|
||||||
margin-left: -5rem;
|
|
||||||
max-width: 100%;
|
|
||||||
margin-bottom: -3rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
background: #f0f2f5;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.mobile{
|
min-width: 50%;
|
||||||
position: absolute;
|
img{
|
||||||
top: 6rem;
|
height: 100%;
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
align-items: center;
|
|
||||||
.logo{
|
|
||||||
max-width: 4rem;
|
|
||||||
img{
|
|
||||||
max-width: 100%;
|
|
||||||
margin-bottom: 0.5rem;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.company{
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: flex-end;
|
|
||||||
span:first-child{
|
|
||||||
color: #000;
|
|
||||||
font-size: 1.6rem;
|
|
||||||
font-weight: bold;
|
|
||||||
letter-spacing: 0.3rem;
|
|
||||||
}
|
|
||||||
span:last-child{
|
|
||||||
color: #000;
|
|
||||||
font-size: 0.8rem;
|
|
||||||
line-height: 1.2rem;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
:type="collapsed ? 'menu-unfold' : 'menu-fold'"
|
:type="collapsed ? 'menu-unfold' : 'menu-fold'"
|
||||||
@click="toggle"/>
|
@click="toggle"/>
|
||||||
|
|
||||||
<span v-if="device === 'desktop'">欢迎进入 Jero-Boot 平台</span>
|
<span v-if="device === 'desktop'">欢迎进入来款系统管理平台</span>
|
||||||
<span v-else>Jero-Boot</span>
|
<span v-else>Jero-Boot</span>
|
||||||
|
|
||||||
<user-menu :theme="theme"/>
|
<user-menu :theme="theme"/>
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
<router-link :to="{name:'dashboard'}">
|
<router-link :to="{name:'dashboard'}">
|
||||||
|
|
||||||
<!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo颜色根据主题颜色变化 -->
|
<!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo颜色根据主题颜色变化 -->
|
||||||
<img v-if="navTheme === 'dark'" src="~@/assets/logo.png" alt="logo">
|
<img v-if="navTheme === 'dark'" src="~@/assets/logo.png" alt="logo" :class='smallImg ? "smallImg": ""'>
|
||||||
<img v-else src="~@/assets/logo.png" alt="logo">
|
<img v-else src="~@/assets/logo.png" alt="logo" :class='smallImg ? "smallImg": ""'>
|
||||||
<!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo颜色根据主题颜色变化 -->
|
<!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo颜色根据主题颜色变化 -->
|
||||||
|
|
||||||
<h1 v-if="showTitle">{{ title }}</h1>
|
<!-- <h1 v-if="showTitle">{{ title }}</h1>-->
|
||||||
</router-link>
|
</router-link>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -29,6 +29,16 @@
|
|||||||
default: true,
|
default: true,
|
||||||
required: false
|
required: false
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
smallImg: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
sidebarOpened(val) {
|
||||||
|
this.smallImg = !val
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
@@ -55,5 +65,8 @@
|
|||||||
&.light .logo {
|
&.light .logo {
|
||||||
background-color: @primary-color;
|
background-color: @primary-color;
|
||||||
}
|
}
|
||||||
|
.smallImg {
|
||||||
|
height: 16px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
+197
-312
@@ -1,26 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main">
|
||||||
<a-form v-if="!mobile" :form="form" class="user-layout-login" ref="formLogin" id="formLogin">
|
<a-form :form="form" class="user-layout-login" ref="formLogin" id="formLogin">
|
||||||
<div class="user-box">
|
<div class="user-box">
|
||||||
<span class="title">用户登录</span>
|
<span class="title">
|
||||||
|
<img src='../../assets/userLogin.png' alt=''>
|
||||||
|
</span>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="6"></a-col>
|
||||||
<a-col :span="18">
|
<a-col :span="12">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
size="large"
|
size="large"
|
||||||
v-decorator="['username',{initialValue:'', rules: validatorRules.username.rules,validateTrigger: 'blur'}]"
|
v-decorator="['username',{initialValue:'', rules: validatorRules.username.rules,validateTrigger: 'blur'}]"
|
||||||
type="text"
|
type="text"
|
||||||
placeholder="请输入帐号">
|
placeholder="请输入帐号">
|
||||||
<a-icon slot="prefix" type="user" :style="{ color: '#B3B7C2',fontSize:'20px' }" />
|
<a-icon slot="prefix" type="user" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="6"></a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="6"></a-col>
|
||||||
<a-col :span="18">
|
<a-col :span="12">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
v-decorator="['password',{initialValue:'', rules: validatorRules.password.rules,validateTrigger: 'blur'}]"
|
v-decorator="['password',{initialValue:'', rules: validatorRules.password.rules,validateTrigger: 'blur'}]"
|
||||||
@@ -29,15 +31,15 @@
|
|||||||
autocomplete="false"
|
autocomplete="false"
|
||||||
placeholder="请输入密码"
|
placeholder="请输入密码"
|
||||||
>
|
>
|
||||||
<a-icon slot="prefix" type="lock" :style="{ color: '#B3B7C2',fontSize:'20px' }" />
|
<a-icon slot="prefix" type="lock" :style="{ color: '#B3B7C2',fontSize:'20px' }"/>
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="6"></a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row style="margin-bottom: 0%;">
|
<a-row style="margin-bottom: 0%;">
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="6"></a-col>
|
||||||
<a-col :span="12">
|
<a-col :span="7">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
v-decorator="['inputCode',validatorRules.inputCode]"
|
v-decorator="['inputCode',validatorRules.inputCode]"
|
||||||
@@ -46,131 +48,43 @@
|
|||||||
@change="inputCodeChange"
|
@change="inputCodeChange"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
placeholder="请输入验证码">
|
placeholder="请输入验证码">
|
||||||
<a-icon slot="prefix" type="safety" :style="{ color: '#B3B7C2',fontSize:'20px'}" />
|
<a-icon slot="prefix" type="safety" :style="{ color: '#B3B7C2',fontSize:'20px'}"/>
|
||||||
</a-input>
|
</a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="6" style="text-align: right">
|
<a-col :span="5" class='code' style='text-align: right'>
|
||||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage"
|
<img v-if="requestCodeSuccess" :src="randCodeImage" @click="handleChangeCheckCode"/>
|
||||||
@click="handleChangeCheckCode" />
|
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode"/>
|
||||||
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode" />
|
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="4"></a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row style="margin-bottom: 2%;">
|
<a-row class="login-btn">
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="6"></a-col>
|
||||||
<a-col :span="7">
|
<a-col :span="12">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-checkbox v-decorator="['rememberMe', {initialValue: true, valuePropName: 'checked'}]">自动登录</a-checkbox>
|
<a-button
|
||||||
|
block
|
||||||
|
size="large"
|
||||||
|
type="primary"
|
||||||
|
htmlType="submit"
|
||||||
|
:loading="loginBtn"
|
||||||
|
@click.stop.prevent="handleSubmit"
|
||||||
|
:disabled="loginBtn">
|
||||||
|
{{ loginBtn ? "登录中" : "登录" }}
|
||||||
|
</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="6"></a-col>
|
<a-col :span="6"></a-col>
|
||||||
<a-col :span="5" style="text-align: right;color: #1891FF;">
|
|
||||||
<a-form-item>
|
|
||||||
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
|
|
||||||
忘记密码
|
|
||||||
</router-link>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
</a-row>
|
||||||
<a-row class="login-btn">
|
<a-row style="margin-bottom: 2%;">
|
||||||
<a-col :span="3"></a-col>
|
<a-col :span="3"></a-col>
|
||||||
<a-col :span="18">
|
|
||||||
<a-form-item>
|
|
||||||
<a-button
|
|
||||||
block
|
|
||||||
size="large"
|
|
||||||
type="primary"
|
|
||||||
htmlType="submit"
|
|
||||||
:loading="loginBtn"
|
|
||||||
@click.stop.prevent="handleSubmit"
|
|
||||||
:disabled="loginBtn">
|
|
||||||
{{ loginBtn ? "登录中" : "登录" }}
|
|
||||||
</a-button>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="3"></a-col>
|
|
||||||
</a-row>
|
|
||||||
</div>
|
|
||||||
</a-form>
|
|
||||||
<a-form v-if="mobile" :form="form" class="user-layout-login user-layout-login-mobile" ref="formLogin"
|
|
||||||
id="formLogin">
|
|
||||||
<div class="user-box user-box-mobile">
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item>
|
|
||||||
<a-input
|
|
||||||
size="large"
|
|
||||||
v-decorator="['username',{initialValue:'', rules: validatorRules.username.rules,validateTrigger: 'blur'}]"
|
|
||||||
type="text"
|
|
||||||
placeholder="请输入帐号">
|
|
||||||
<a-icon slot="prefix" type="user" :style="{ color: '#B3B7C2',fontSize:'20px' }" />
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item>
|
|
||||||
<a-input
|
|
||||||
v-decorator="['password',{initialValue:'', rules: validatorRules.password.rules,validateTrigger: 'blur'}]"
|
|
||||||
size="large"
|
|
||||||
type="password"
|
|
||||||
autocomplete="false"
|
|
||||||
placeholder="请输入密码"
|
|
||||||
>
|
|
||||||
<a-icon slot="prefix" type="lock" :style="{ color: '#B3B7C2',fontSize:'20px' }" />
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="14">
|
|
||||||
<a-form-item>
|
|
||||||
<a-input
|
|
||||||
v-decorator="['inputCode',validatorRules.inputCode]"
|
|
||||||
size="large"
|
|
||||||
type="text"
|
|
||||||
@change="inputCodeChange"
|
|
||||||
placeholder="请输入验证码">
|
|
||||||
<a-icon slot="prefix" type="safety" :style="{ color: '#B3B7C2',fontSize:'20px'}" />
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="10" style="text-align: right">
|
|
||||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage"
|
|
||||||
@click="handleChangeCheckCode" />
|
|
||||||
<img v-else style="margin-top: 2px;" src="../../assets/checkcode.png" @click="handleChangeCheckCode" />
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row>
|
|
||||||
<a-col :span="10">
|
|
||||||
<a-form-item>
|
|
||||||
<a-checkbox v-decorator="['rememberMe', {initialValue: true, valuePropName: 'checked'}]">自动登录</a-checkbox>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="4"></a-col>
|
<a-col :span="4"></a-col>
|
||||||
<a-col :span="9" style="text-align: right;color: #1891FF;">
|
<a-col :span="6"></a-col>
|
||||||
|
<a-col :span="5" style="text-align: right;">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<router-link :to="{ name: 'alteration'}" class="forge-password" style="float: right;">
|
<span @click='forgetPassword' class="forget-password" style="float: right;color: #BFBFBF;">
|
||||||
忘记密码
|
忘记密码 <img style='height: 14px' src='../../assets/wenhao.png' alt=''>
|
||||||
</router-link>
|
</span>
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-row class="login-btn">
|
|
||||||
<a-col :span="24">
|
|
||||||
<a-form-item>
|
|
||||||
<a-button
|
|
||||||
block
|
|
||||||
size="large"
|
|
||||||
type="primary"
|
|
||||||
htmlType="submit"
|
|
||||||
:loading="loginBtn"
|
|
||||||
@click.stop.prevent="handleSubmit"
|
|
||||||
:disabled="loginBtn">
|
|
||||||
{{ loginBtn ? "登录中" : "登录" }}
|
|
||||||
</a-button>
|
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
@@ -178,58 +92,55 @@
|
|||||||
</a-form>
|
</a-form>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import { mapActions } from "vuex"
|
||||||
|
import { timeFix } from "@/utils/util"
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { mapActions } from 'vuex'
|
import { ACCESS_TOKEN } from "@/store/mutation-types"
|
||||||
import { timeFix } from '@/utils/util'
|
import { postAction,getAction } from '@/api/manage'
|
||||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import {getRSAPublicKey} from '@/api/login.js'
|
||||||
import { postAction, getAction } from '@/api/manage'
|
import {JSEncrypt} from 'jsencrypt'
|
||||||
import { getRSAPublicKey } from '@/api/login.js'
|
|
||||||
import { JSEncrypt } from 'jsencrypt'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Login',
|
components: {},
|
||||||
data() {
|
data () {
|
||||||
return {
|
return {
|
||||||
loginBtn: false,
|
loginBtn: false,
|
||||||
mobile: isMobile(),
|
|
||||||
// login type: 0 email, 1 username, 2 telephone
|
|
||||||
loginType: 0,
|
loginType: 0,
|
||||||
stepCaptchaVisible: false,
|
stepCaptchaVisible: false,
|
||||||
form: this.$form.createForm(this),
|
form: this.$form.createForm(this),
|
||||||
state: {
|
state: {
|
||||||
time: 60,
|
time: 60,
|
||||||
smsSendBtn: false
|
smsSendBtn: false,
|
||||||
},
|
},
|
||||||
validatorRules: {
|
validatorRules:{
|
||||||
username: { rules: [{ required: true, message: '请输入用户名!' }, { validator: this.handleUsernameOrEmail }] },
|
username:{rules: [{ required: true, message: '请输入用户名!'},{validator: this.handleUsernameOrEmail}]},
|
||||||
password: { rules: [{ required: true, message: '请输入密码!', validator: 'click' }] },
|
password:{rules: [{ required: true, message: '请输入密码!',validator: 'click'}]},
|
||||||
mobile: { rules: [{ validator: this.validateMobile }] },
|
mobile:{rules: [{validator:this.validateMobile}]},
|
||||||
captcha: { rule: [{ required: true, message: '请输入验证码!' }] },
|
captcha:{rule: [{ required: true, message: '请输入验证码!'}]},
|
||||||
inputCode: { rules: [{ required: true, message: '请输入验证码!' }] }
|
inputCode:{rules: [{ required: true, message: '请输入验证码!'}]}
|
||||||
},
|
},
|
||||||
velorifiedCode: '',
|
velorifiedCode:"",
|
||||||
inputCodeContent: '',
|
inputCodeContent:"",
|
||||||
inputCodeNull: true,
|
inputCodeNull:true,
|
||||||
currentUsername: '',
|
currentUsername:"",
|
||||||
currdatetime: '',
|
currdatetime:'',
|
||||||
randCodeImage: '',
|
randCodeImage:'',
|
||||||
requestCodeSuccess: false,
|
requestCodeSuccess:false,
|
||||||
rsaPublicKey: ''
|
rsaPublicKey:''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created () {
|
||||||
this.currdatetime = new Date().getTime()
|
this.currdatetime = new Date().getTime();
|
||||||
Vue.ls.remove(ACCESS_TOKEN)
|
Vue.ls.remove(ACCESS_TOKEN)
|
||||||
this.getRouterData()
|
this.getRouterData();
|
||||||
this.handleChangeCheckCode()
|
this.handleChangeCheckCode();
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(['Login', 'Logout', 'PhoneLogin']),
|
...mapActions(['Login', 'Logout', 'PhoneLogin']),
|
||||||
handleUsernameOrEmail(rule, value, callback) {
|
handleUsernameOrEmail (rule, value, callback) {
|
||||||
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/
|
const regex = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
|
||||||
if (regex.test(value)) {
|
if (regex.test(value)) {
|
||||||
this.loginType = 0
|
this.loginType = 0
|
||||||
} else {
|
} else {
|
||||||
@@ -237,248 +148,222 @@ export default {
|
|||||||
}
|
}
|
||||||
callback()
|
callback()
|
||||||
},
|
},
|
||||||
handleSubmit() {
|
handleSubmit () {
|
||||||
let that = this
|
let that = this
|
||||||
let loginParams = {}
|
let loginParams = {};
|
||||||
that.loginBtn = true
|
that.loginBtn = true;
|
||||||
that.form.validateFields(['username', 'password', 'inputCode', 'rememberMe'], { force: true }, (err, values) => {
|
that.form.validateFields([ 'username', 'password','inputCode', 'rememberMe' ], { force: true }, (err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
|
|
||||||
loginParams.remember_me = values.rememberMe
|
loginParams.remember_me = values.rememberMe
|
||||||
loginParams.captcha = that.inputCodeContent
|
loginParams.captcha = that.inputCodeContent
|
||||||
loginParams.checkKey = that.currdatetime
|
loginParams.checkKey = that.currdatetime
|
||||||
loginParams.rsaPublicKey = that.rsaPublicKey
|
loginParams.rsaPublicKey = that.rsaPublicKey;
|
||||||
// 新建JSEncrypt对象
|
// 新建JSEncrypt对象
|
||||||
let encrypt = new JSEncrypt()
|
let encrypt = new JSEncrypt();
|
||||||
encrypt.setPublicKey(loginParams.rsaPublicKey)
|
encrypt.setPublicKey(loginParams.rsaPublicKey);
|
||||||
// 公钥加密
|
// 公钥加密
|
||||||
loginParams.username = encrypt.encrypt(values.username)
|
loginParams.username = encrypt.encrypt(values.username)
|
||||||
loginParams.password = encrypt.encrypt(values.password)
|
loginParams.password = encrypt.encrypt(values.password)
|
||||||
//登录
|
//登录
|
||||||
that.Login(loginParams).then((res) => {
|
that.Login(loginParams).then((res) => {
|
||||||
console.log(res)
|
|
||||||
this.loginSuccess()
|
this.loginSuccess()
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
if (err.code === 500) {
|
if (err.code === 500) {
|
||||||
// 刷新验证码
|
// 刷新验证码
|
||||||
this.handleChangeCheckCode()
|
this.handleChangeCheckCode();
|
||||||
}
|
}
|
||||||
that.requestFailed(err)
|
that.requestFailed(err);
|
||||||
})
|
});
|
||||||
} else {
|
}else {
|
||||||
that.loginBtn = false
|
that.loginBtn = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getCaptcha(e) {
|
getCaptcha (e) {
|
||||||
e.preventDefault()
|
e.preventDefault();
|
||||||
let that = this
|
let that = this;
|
||||||
this.form.validateFields(['mobile'], { force: true }, (err, values) => {
|
this.form.validateFields([ 'mobile' ], { force: true },(err,values) => {
|
||||||
if (!values.mobile) {
|
if(!values.mobile){
|
||||||
that.cmsFailed('请输入手机号')
|
that.cmsFailed("请输入手机号");
|
||||||
} else if (!err) {
|
}else if (!err) {
|
||||||
this.state.smsSendBtn = true
|
this.state.smsSendBtn = true;
|
||||||
let interval = window.setInterval(() => {
|
let interval = window.setInterval(() => {
|
||||||
if (that.state.time-- <= 0) {
|
if (that.state.time-- <= 0) {
|
||||||
that.state.time = 60
|
that.state.time = 60;
|
||||||
that.state.smsSendBtn = false
|
that.state.smsSendBtn = false;
|
||||||
window.clearInterval(interval)
|
window.clearInterval(interval);
|
||||||
}
|
}
|
||||||
}, 1000)
|
}, 1000);
|
||||||
|
|
||||||
const hide = this.$message.loading('验证码发送中..', 0)
|
const hide = this.$message.loading('验证码发送中..', 0);
|
||||||
let smsParams = {}
|
let smsParams = {};
|
||||||
smsParams.mobile = values.mobile
|
smsParams.mobile=values.mobile;
|
||||||
smsParams.smsmode = '0'
|
smsParams.smsmode="0";
|
||||||
postAction('/sys/sms', smsParams)
|
postAction("/sys/sms",smsParams)
|
||||||
.then(res => {
|
.then(res => {
|
||||||
if (!res.success) {
|
if(!res.success){
|
||||||
setTimeout(hide, 0)
|
setTimeout(hide, 0);
|
||||||
this.cmsFailed(res.message)
|
this.cmsFailed(res.message);
|
||||||
}
|
}
|
||||||
setTimeout(hide, 500)
|
setTimeout(hide, 500);
|
||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
setTimeout(hide, 1)
|
setTimeout(hide, 1);
|
||||||
clearInterval(interval)
|
clearInterval(interval);
|
||||||
that.state.time = 60
|
that.state.time = 60;
|
||||||
that.state.smsSendBtn = false
|
that.state.smsSendBtn = false;
|
||||||
this.requestFailed(err)
|
this.requestFailed(err);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
);
|
||||||
},
|
},
|
||||||
handleChangeCheckCode() {
|
// 忘记密码
|
||||||
this.currdatetime = new Date().getTime()
|
forgetPassword() {
|
||||||
getAction(`/sys/randomImage/${this.currdatetime}`).then(res => {
|
this.$router.push({ name: 'alteration' })
|
||||||
if (res.success) {
|
},
|
||||||
|
handleChangeCheckCode(){
|
||||||
|
this.currdatetime = new Date().getTime();
|
||||||
|
getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{
|
||||||
|
if(res.success){
|
||||||
this.randCodeImage = res.result
|
this.randCodeImage = res.result
|
||||||
this.requestCodeSuccess = true
|
this.requestCodeSuccess=true
|
||||||
} else {
|
}else{
|
||||||
this.$message.error(res.message)
|
this.$message.error(res.message)
|
||||||
this.requestCodeSuccess = false
|
this.requestCodeSuccess=false
|
||||||
}
|
}
|
||||||
}).catch(() => {
|
}).catch(()=>{
|
||||||
this.requestCodeSuccess = false
|
this.requestCodeSuccess=false
|
||||||
})
|
})
|
||||||
this.getPublicKey()
|
this.getPublicKey();
|
||||||
},
|
},
|
||||||
//获取RSA公钥
|
//获取RSA公钥
|
||||||
getPublicKey() {
|
getPublicKey(){
|
||||||
// 获取公钥
|
// 获取公钥
|
||||||
getRSAPublicKey().then(res => {
|
getRSAPublicKey().then(res => {
|
||||||
this.rsaPublicKey = res.result
|
this.rsaPublicKey = res.result
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
loginSuccess() {
|
loginSuccess () {
|
||||||
this.$router.push({ path: '/dashboard/analysis' }).catch((res) => {
|
// this.$router.push({ path: "/dashboard/analysis" }).catch((res)=>{})
|
||||||
console.log(res)
|
// 进入首页
|
||||||
})
|
this.$router.push({ path: "/" }).catch((res)=>{})
|
||||||
this.$notification.success({
|
this.$notification.success({
|
||||||
message: '欢迎',
|
message: '欢迎',
|
||||||
description: `${timeFix()},欢迎回来`
|
description: `${timeFix()},欢迎回来`,
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
cmsFailed(err) {
|
cmsFailed(err){
|
||||||
this.$notification['error']({
|
this.$notification[ 'error' ]({
|
||||||
|
message: "登录失败",
|
||||||
|
description:err,
|
||||||
|
duration: 4,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
requestFailed (err) {
|
||||||
|
this.$notification[ 'error' ]({
|
||||||
message: '登录失败',
|
message: '登录失败',
|
||||||
description: err,
|
description: ((err.response || {}).data || {}).message || err.message || "请求出现错误,请稍后再试",
|
||||||
duration: 4
|
duration: 4,
|
||||||
})
|
});
|
||||||
|
this.loginBtn = false;
|
||||||
},
|
},
|
||||||
requestFailed(err) {
|
validateMobile(rule,value,callback){
|
||||||
this.$notification['error']({
|
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)){
|
||||||
message: '登录失败',
|
callback();
|
||||||
description: ((err.response || {}).data || {}).message || err.message || '请求出现错误,请稍后再试',
|
}else{
|
||||||
duration: 4
|
callback("您的手机号码格式不正确!");
|
||||||
})
|
|
||||||
this.loginBtn = false
|
|
||||||
},
|
|
||||||
validateMobile(rule, value, callback) {
|
|
||||||
if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)) {
|
|
||||||
callback()
|
|
||||||
} else {
|
|
||||||
callback('您的手机号码格式不正确!')
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
validateInputCode(rule, value, callback) {
|
validateInputCode(rule,value,callback){
|
||||||
if (!value || this.verifiedCode == this.inputCodeContent) {
|
if(!value || this.verifiedCode==this.inputCodeContent){
|
||||||
callback()
|
callback();
|
||||||
} else {
|
}else{
|
||||||
callback('您输入的验证码不正确!')
|
callback("您输入的验证码不正确!");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
generateCode(value) {
|
generateCode(value){
|
||||||
this.verifiedCode = value.toLowerCase()
|
this.verifiedCode = value.toLowerCase()
|
||||||
},
|
},
|
||||||
inputCodeChange(e) {
|
inputCodeChange(e){
|
||||||
this.inputCodeContent = e.target.value
|
this.inputCodeContent = e.target.value
|
||||||
},
|
},
|
||||||
getRouterData() {
|
getRouterData(){
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
if (this.$route.params.username) {
|
if (this.$route.params.username) {
|
||||||
this.form.setFieldsValue({
|
this.form.setFieldsValue({
|
||||||
'username': this.$route.params.username
|
'username': this.$route.params.username
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 判断当前设备
|
|
||||||
function isMobile() {
|
|
||||||
var userAgentInfo = navigator.userAgent
|
|
||||||
|
|
||||||
var mobileAgents = ['Android', 'iPhone', 'SymbianOS', 'Windows Phone', 'iPad', 'iPod']
|
|
||||||
|
|
||||||
var mobile_flag = false
|
|
||||||
|
|
||||||
//根据userAgent判断是否是手机
|
|
||||||
for (var v = 0; v < mobileAgents.length; v++) {
|
|
||||||
if (userAgentInfo.indexOf(mobileAgents[v]) > 0) {
|
|
||||||
mobile_flag = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var screen_width = window.screen.width
|
|
||||||
var screen_height = window.screen.height
|
|
||||||
|
|
||||||
//根据屏幕分辨率判断是否是手机
|
|
||||||
if (screen_width < 500 && screen_height < 800) {
|
|
||||||
mobile_flag = true
|
|
||||||
}
|
|
||||||
return mobile_flag
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="less">
|
<style lang="less" scoped>
|
||||||
.ant-input-affix-wrapper /deep/ .ant-input:not(:first-child) {
|
.ant-input-affix-wrapper/deep/ .ant-input:not(:first-child){
|
||||||
padding-left: 40px;
|
padding-left: 40px;
|
||||||
}
|
}
|
||||||
|
.ant-row{
|
||||||
.ant-row {
|
|
||||||
margin-bottom: 4%;
|
margin-bottom: 4%;
|
||||||
}
|
}
|
||||||
|
.main{
|
||||||
.main {
|
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
.user-layout-login{
|
||||||
.user-layout-login {
|
|
||||||
z-index: 99;
|
z-index: 99;
|
||||||
width: 24%;
|
width: 50%;
|
||||||
height: 56%;
|
box-sizing: border-box;
|
||||||
padding: 3% 0 3% 0;
|
height: 60%;
|
||||||
min-width: 332px;
|
|
||||||
min-height: 460px;
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 20px;
|
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 8%;
|
right: 0;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
|
.user-box{
|
||||||
.user-box {
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
.title{
|
||||||
.title {
|
display: flex;
|
||||||
display: block;
|
justify-content: center;
|
||||||
color: #1891FF;
|
img{
|
||||||
font-size: 28px;
|
width: 395px;
|
||||||
font-weight: 500;
|
height: 124px;
|
||||||
margin: 0 0 5% 0;
|
}
|
||||||
text-align: center;
|
|
||||||
}
|
}
|
||||||
|
.code{
|
||||||
.login-btn {
|
img{
|
||||||
|
height: 60px;
|
||||||
|
border-radius: 30px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.login-btn{
|
||||||
|
margin-top: 20px;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
font-size: 10px;
|
font-size: 10px;
|
||||||
|
/deep/.ant-btn-primary{
|
||||||
|
height: 60px;
|
||||||
|
background: #069F99;
|
||||||
|
border: none;
|
||||||
|
border-radius: 30px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/deep/.ant-row{
|
||||||
.user-layout-login-mobile {
|
margin-bottom: 0 !important;
|
||||||
right: 0;
|
}
|
||||||
width: 100%;
|
/deep/.ant-input-affix-wrapper .ant-input{
|
||||||
min-width: 0 !important;
|
border-radius: 30px;
|
||||||
height: 46% !important;
|
height: 60px;
|
||||||
background: transparent;
|
border: 1px solid #E6E3E3;
|
||||||
min-height: 0;
|
}
|
||||||
padding: 0 2rem 0 2rem;
|
.forget-password{
|
||||||
position: absolute;
|
cursor: pointer;
|
||||||
top: 50%;
|
|
||||||
margin-top: 6rem;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
|
|
||||||
.ant-row {
|
|
||||||
margin-bottom: 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,69 +1,340 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-card :bordered="false" style="width: 100%;text-align: center;">
|
<a-card :bordered="false" style="width: 100%;height: 100%;text-align: left;">
|
||||||
<a-steps class="steps" :current="currentTab">
|
<div class='alteration-head logo'>
|
||||||
<a-step title="手机验证"/>
|
<router-link :to="{name:'dashboard'}">
|
||||||
<a-step title="密码"/>
|
<img src="~@/assets/logo.png" alt="logo">
|
||||||
<a-step title="完成"/>
|
<h1>标准所来款管理系统</h1>
|
||||||
</a-steps>
|
</router-link>
|
||||||
<div class="content">
|
</div>
|
||||||
<step2 v-if="currentTab === 0" @nextStep="nextStep"/>
|
<div class='alteration-center'>
|
||||||
<step3 v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep" :userList="userList"/>
|
<div class='alteration-content'>
|
||||||
<step4 v-if="currentTab === 2" @prevStep="prevStep" @finish="finish" :userList="userList"/>
|
<a-form :form="form">
|
||||||
|
<span class='setPassword'>设置密码</span>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span='22'>
|
||||||
|
<a-form-item
|
||||||
|
label="手机"
|
||||||
|
:labelCol="{span: 5}"
|
||||||
|
:wrapperCol="{span: 19}"
|
||||||
|
>
|
||||||
|
<a-input
|
||||||
|
type="text"
|
||||||
|
v-decorator="['phone',{ rules: validatorRules.phone.rules}]"
|
||||||
|
placeholder="请输入手机号">
|
||||||
|
</a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span='6'></a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span='22'>
|
||||||
|
<a-form-item
|
||||||
|
class='captcha'
|
||||||
|
label="验证码"
|
||||||
|
:labelCol="{span: 5}"
|
||||||
|
:wrapperCol="{span: 19}">
|
||||||
|
<a-input
|
||||||
|
v-decorator="['captcha', { rules: validatorRules.captcha.rules}]"
|
||||||
|
type="text"
|
||||||
|
placeholder="验证码">
|
||||||
|
</a-input>
|
||||||
|
<a-button
|
||||||
|
tabindex="-1"
|
||||||
|
size="default"
|
||||||
|
:disabled="state.smsSendBtn"
|
||||||
|
@click.stop.prevent="getCaptcha"
|
||||||
|
v-text="!state.smsSendBtn && '获取验证码' || (state.time+' s')"></a-button>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span='6'></a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span='22'>
|
||||||
|
<a-form-item
|
||||||
|
label="新密码"
|
||||||
|
:labelCol="{span: 5}"
|
||||||
|
:wrapperCol="{span: 19}">
|
||||||
|
<a-input
|
||||||
|
placeholder="新密码"
|
||||||
|
v-decorator="['password', { rules: validatorRules.password.rules}]"
|
||||||
|
type="password">
|
||||||
|
</a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span='6'></a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span='22'>
|
||||||
|
<a-form-item
|
||||||
|
label="确认密码"
|
||||||
|
:labelCol="{span: 5}"
|
||||||
|
:wrapperCol="{span: 19}">
|
||||||
|
<a-input
|
||||||
|
placeholder="确认密码"
|
||||||
|
v-decorator="['confirmPassword', { rules: validatorRules.confirmPassword.rules}]"
|
||||||
|
type="password"
|
||||||
|
autocomplete="false">
|
||||||
|
</a-input>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span='6'></a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :span='8'></a-col>
|
||||||
|
<a-col :span='14'>
|
||||||
|
<a-form-item class='btn'>
|
||||||
|
<a-button :loading="loading" type="primary" @click="submit" style="margin-left:20px">提交</a-button>
|
||||||
|
<a-button @click='cancel'>取消</a-button>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span='2'></a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</a-card>
|
</a-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Step1 from './Step1'
|
import { getAction, postAction } from '@/api/manage'
|
||||||
import Step2 from './Step2'
|
|
||||||
import Step3 from './Step3'
|
|
||||||
import Step4 from './Step4'
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Alteration',
|
name: "Alteration",
|
||||||
components: {
|
components: {},
|
||||||
Step1,
|
data() {
|
||||||
Step2,
|
return {
|
||||||
Step3,
|
form: this.$form.createForm(this),
|
||||||
Step4
|
loading: false,
|
||||||
|
validatorRules: {
|
||||||
|
phone: {
|
||||||
|
rules: [
|
||||||
|
{required: true, message: '请输入手机号码!'},{validator: this.validatePhone}],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
captcha: {
|
||||||
|
rules: [{required: true, message: '请输入短信验证码!'}],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
password: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/,
|
||||||
|
message: '密码由8位数字、大小写字母和特殊符号组成!!'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
confirmPassword: {
|
||||||
|
rules: [
|
||||||
|
{required: true, message: '密码不能为空!'},
|
||||||
|
{validator: this.handlePasswordCheck}
|
||||||
|
],
|
||||||
|
validateTrigger: 'blur'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
state: {
|
||||||
|
time: 60,
|
||||||
|
smsSendBtn: false,
|
||||||
|
},
|
||||||
|
userList: {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
submit() {
|
||||||
|
let that = this
|
||||||
|
that.loading = true
|
||||||
|
this.form.validateFields((err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
let params = {}
|
||||||
|
console.log(values, '======values')
|
||||||
|
params.phone = values.phone;
|
||||||
|
params.password = values.password;
|
||||||
|
params.captcha = values.captcha;
|
||||||
|
params.confirmPassword = values.confirmPassword;
|
||||||
|
getAction("/sys/user/passwordChange", params).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
that.loading = false
|
||||||
|
that.$router.go(-1)
|
||||||
|
} else {
|
||||||
|
this.passwordFailed(res.message);
|
||||||
|
that.loading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
that.loading = false
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
data() {
|
cancel() {
|
||||||
return {
|
this.$router.go(-1)
|
||||||
description: '将一个冗长或用户不熟悉的表单任务分成多个步骤,指导用户完成。',
|
},
|
||||||
currentTab: 0,
|
passwordFailed(err) {
|
||||||
userList: {},
|
this.$notification[ 'error' ]({
|
||||||
// form
|
message: "更改密码失败",
|
||||||
form: null,
|
description:err,
|
||||||
|
duration: 4,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
validatePhone(rule,value,callback){
|
||||||
|
if(value){
|
||||||
|
var myreg=/^[1][3,4,5,7,8][0-9]{9}$/;
|
||||||
|
if(!myreg.test(value)){
|
||||||
|
callback("请输入正确的手机号")
|
||||||
|
}else{
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
callback()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
handlePasswordCheck (rule, value, callback) {
|
||||||
|
let password = this.form.getFieldValue('password')
|
||||||
// handler
|
if (value && password && value.trim() !== password.trim()) {
|
||||||
nextStep(data) {
|
callback(new Error('两次密码不一致'))
|
||||||
this.userList = data
|
|
||||||
if (this.currentTab < 4) {
|
|
||||||
this.currentTab += 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
prevStep(data) {
|
|
||||||
this.userList = data
|
|
||||||
if (this.currentTab > 0) {
|
|
||||||
this.currentTab -= 1
|
|
||||||
}
|
|
||||||
},
|
|
||||||
finish() {
|
|
||||||
this.currentTab = 0
|
|
||||||
}
|
}
|
||||||
|
callback()
|
||||||
|
},
|
||||||
|
getCaptcha(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
let that = this;
|
||||||
|
let phone=that.form.getFieldValue("phone")
|
||||||
|
if(!phone){
|
||||||
|
this.cmsFailed("手机号不能为空!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.state.smsSendBtn = true;
|
||||||
|
let interval = window.setInterval(() => {
|
||||||
|
if (that.state.time-- <= 0) {
|
||||||
|
that.state.time = 60;
|
||||||
|
that.state.smsSendBtn = false;
|
||||||
|
window.clearInterval(interval);
|
||||||
|
}
|
||||||
|
}, 1000);
|
||||||
|
|
||||||
|
const hide = this.$message.loading('验证码发送中..', 0);
|
||||||
|
let smsParams = {
|
||||||
|
mobile: phone,
|
||||||
|
smsmode: "2"
|
||||||
|
};
|
||||||
|
postAction("/sys/sms", smsParams).then(res => {
|
||||||
|
if (!res.success) {
|
||||||
|
setTimeout(hide, 1);
|
||||||
|
this.cmsFailed(res.message);
|
||||||
|
}
|
||||||
|
setTimeout(hide, 500);
|
||||||
|
})
|
||||||
|
},
|
||||||
|
cmsFailed(err) {
|
||||||
|
this.$notification['error']({
|
||||||
|
message: "验证错误",
|
||||||
|
description: err,
|
||||||
|
duration: 4,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.steps {
|
/deep/.ant-card{
|
||||||
max-width: 750px;
|
width: 100%;
|
||||||
margin: 16px auto;
|
}
|
||||||
|
/deep/.ant-card-body{
|
||||||
|
padding: 0 !important;
|
||||||
|
height: 100%;
|
||||||
|
background: #F0F2F5;
|
||||||
|
}
|
||||||
|
.alteration-center{
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background: #F0F2F5;
|
||||||
|
}
|
||||||
|
.alteration-content{
|
||||||
|
margin: auto;
|
||||||
|
width: 1000px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
background: #fff;
|
||||||
|
.setPassword{
|
||||||
|
font-size: 26px;
|
||||||
|
display: block;
|
||||||
|
background: #fff;
|
||||||
|
height: 60px;
|
||||||
|
text-align: center !important;
|
||||||
|
margin-top: 30px;
|
||||||
}
|
}
|
||||||
.ant-steps-item{
|
}
|
||||||
overflow: hidden;
|
/deep/.ant-form{
|
||||||
|
width: 500px;
|
||||||
|
height: 500px;
|
||||||
|
}
|
||||||
|
.alteration-head{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
width: 100%;
|
||||||
|
background: #069F99;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
.logo {
|
||||||
|
box-shadow: none !important;
|
||||||
|
transition: background 300ms;
|
||||||
|
height: 60px;
|
||||||
|
line-height: 60px;
|
||||||
|
padding-left: 12px;
|
||||||
|
a {
|
||||||
|
color: white;
|
||||||
|
&:hover {
|
||||||
|
color: rgba(255, 255, 255, 0.8);
|
||||||
|
}
|
||||||
|
h1 {
|
||||||
|
margin-left: 12px;
|
||||||
|
color: #fff;
|
||||||
|
font-size: 16px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.alteration-content{
|
||||||
|
|
||||||
|
}
|
||||||
|
/deep/.ant-row{
|
||||||
|
margin-bottom: 20px !important;
|
||||||
|
height: 60px;
|
||||||
|
}
|
||||||
|
/deep/.ant-form-item-label{
|
||||||
|
height: 50px;
|
||||||
|
line-height: 50px;
|
||||||
|
}
|
||||||
|
/deep/.ant-input{
|
||||||
|
border-radius: 30px;
|
||||||
|
height: 50px;
|
||||||
|
border: 1px solid #E6E3E3;
|
||||||
|
}
|
||||||
|
.btn{
|
||||||
|
/deep/button{
|
||||||
|
border-radius: 30px;
|
||||||
|
margin: 0 20px;
|
||||||
|
}
|
||||||
|
.ant-btn-primary{
|
||||||
|
background: #069F99;
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.captcha{
|
||||||
|
position: relative;
|
||||||
|
/deep/button{
|
||||||
|
border: none;
|
||||||
|
color: #069F99;
|
||||||
|
position: absolute;
|
||||||
|
right: 10px;
|
||||||
|
top: -6px;
|
||||||
|
box-shadow: none;
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
@@ -1,183 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div class="main">
|
|
||||||
|
|
||||||
<a-form style="max-width: 500px; margin: 40px auto 0;" :form="form" @keyup.enter.native="nextStep">
|
|
||||||
<a-form-item>
|
|
||||||
<a-input
|
|
||||||
v-decorator="['username',validatorRules.username]"
|
|
||||||
size="large"
|
|
||||||
type="text"
|
|
||||||
autocomplete="false"
|
|
||||||
placeholder="请输入用户账号或手机号">
|
|
||||||
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
<a-row :gutter="0">
|
|
||||||
<a-col :span="14">
|
|
||||||
<a-form-item>
|
|
||||||
<a-input
|
|
||||||
v-decorator="['inputCode',validatorRules.inputCode]"
|
|
||||||
size="large"
|
|
||||||
type="text"
|
|
||||||
@change="inputCodeChange"
|
|
||||||
placeholder="请输入验证码">
|
|
||||||
<a-icon slot="prefix" v-if=" inputCodeContent==verifiedCode " type="smile"
|
|
||||||
:style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
||||||
<a-icon slot="prefix" v-else type="frown" :style="{ color: 'rgba(0,0,0,.25)' }"/>
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="10" style="text-align: right">
|
|
||||||
<img v-if="requestCodeSuccess" style="margin-top: 2px;" :src="randCodeImage" @click="handleChangeCheckCode"/>
|
|
||||||
<img v-else style="margin-top: 2px;" src="../../../assets/checkcode.png" @click="handleChangeCheckCode"/>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
|
||||||
<router-link style="float: left;line-height: 40px;" :to="{ name: 'login' }">使用已有账户登录</router-link>
|
|
||||||
<a-button type="primary" @click="nextStep">下一步</a-button>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getAction,postAction } from '@/api/manage'
|
|
||||||
import { checkOnlyUser } from '@/api/api'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'Step1',
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
form: this.$form.createForm(this),
|
|
||||||
inputCodeContent: '',
|
|
||||||
inputCodeNull: true,
|
|
||||||
verifiedCode: '',
|
|
||||||
validatorRules: {
|
|
||||||
username: {rules: [{required: false}, {validator: this.validateInputUsername}]},
|
|
||||||
inputCode: {rules: [{required: true, message: '请输入验证码!'}]},
|
|
||||||
},
|
|
||||||
randCodeImage:'',
|
|
||||||
requestCodeSuccess:true,
|
|
||||||
currdatetime:''
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created(){
|
|
||||||
this.handleChangeCheckCode()
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleChangeCheckCode(){
|
|
||||||
this.currdatetime = new Date().getTime()
|
|
||||||
getAction(`/sys/randomImage/${this.currdatetime}`).then(res=>{
|
|
||||||
if(res.success){
|
|
||||||
this.randCodeImage = res.result
|
|
||||||
this.requestCodeSuccess=true
|
|
||||||
}else{
|
|
||||||
this.$message.error(res.message)
|
|
||||||
this.requestCodeSuccess=false
|
|
||||||
}
|
|
||||||
}).catch(()=>{
|
|
||||||
this.requestCodeSuccess=false
|
|
||||||
})
|
|
||||||
},
|
|
||||||
nextStep() {
|
|
||||||
let that = this
|
|
||||||
this.form.validateFields((err, values) => {
|
|
||||||
if (!err) {
|
|
||||||
let isPhone = false
|
|
||||||
var params = {}
|
|
||||||
var reg = /^[1-9]\d*$|^0$/
|
|
||||||
var username = values.username
|
|
||||||
if (reg.test(username) == true) {
|
|
||||||
params.phone = username
|
|
||||||
isPhone = true
|
|
||||||
} else {
|
|
||||||
params.username = username
|
|
||||||
}
|
|
||||||
that.validateInputCode().then(()=>{
|
|
||||||
getAction('/sys/user/querySysUser', params).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
var userList = {
|
|
||||||
username: res.result.username,
|
|
||||||
phone: res.result.phone,
|
|
||||||
isPhone: isPhone
|
|
||||||
}
|
|
||||||
setTimeout(function () {
|
|
||||||
that.$emit('nextStep', userList)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
validateInputCode() {
|
|
||||||
return new Promise((resolve,reject)=>{
|
|
||||||
postAction('/sys/checkCaptcha',{
|
|
||||||
captcha:this.inputCodeContent,
|
|
||||||
checkKey:this.currdatetime
|
|
||||||
}).then(res=>{
|
|
||||||
if(res.success){
|
|
||||||
resolve()
|
|
||||||
}else{
|
|
||||||
this.$message.error(res.message)
|
|
||||||
reject()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
inputCodeChange(e) {
|
|
||||||
this.inputCodeContent = e.target.value
|
|
||||||
console.log(this.inputCodeContent)
|
|
||||||
if (!e.target.value || 0 == e.target.value) {
|
|
||||||
this.inputCodeNull = true
|
|
||||||
} else {
|
|
||||||
this.inputCodeContent = this.inputCodeContent.toLowerCase()
|
|
||||||
this.inputCodeNull = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
generateCode(value) {
|
|
||||||
this.verifiedCode = value.toLowerCase()
|
|
||||||
console.log(this.verifiedCode)
|
|
||||||
},
|
|
||||||
validateInputUsername(rule, value, callback) {
|
|
||||||
console.log(value)
|
|
||||||
var reg = /^[0-9]+.?[0-9]*/
|
|
||||||
if (!value) {
|
|
||||||
callback('请输入用户名和手机号!')
|
|
||||||
}
|
|
||||||
|
|
||||||
//判断用户输入账号还是手机号码
|
|
||||||
if (reg.test(value)) {
|
|
||||||
var params = {
|
|
||||||
phone: value,
|
|
||||||
}
|
|
||||||
checkOnlyUser(params).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
callback('用户名不存在!')
|
|
||||||
} else {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const params = {
|
|
||||||
username: value,
|
|
||||||
}
|
|
||||||
checkOnlyUser(params).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
callback('用户名不存在!')
|
|
||||||
} else {
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,204 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<a-form :form="form" style="max-width: 500px; margin: 40px auto 0;" @keyup.enter.native="nextStep">
|
|
||||||
<a-form-item
|
|
||||||
label="手机"
|
|
||||||
:labelCol="{span: 5}"
|
|
||||||
:wrapperCol="{span: 16}"
|
|
||||||
style="text-align: left"
|
|
||||||
>
|
|
||||||
<a-input
|
|
||||||
type="text"
|
|
||||||
autocomplete="false"
|
|
||||||
v-decorator="['phone',{ rules: validatorRules.phone.rule}]"
|
|
||||||
placeholder="请输入手机号">
|
|
||||||
<a-icon slot="prefix" type="phone" :style="{ color: 'rgba(0,0,0,.25)'}"/>
|
|
||||||
</a-input>
|
|
||||||
<a-col :span="3"></a-col>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item
|
|
||||||
label="验证码"
|
|
||||||
:labelCol="{span: 5}"
|
|
||||||
:wrapperCol="{span: 19}"
|
|
||||||
v-if="show">
|
|
||||||
<a-row :gutter="24">
|
|
||||||
<a-col :span="13">
|
|
||||||
<a-input
|
|
||||||
v-decorator="['captcha',validatorRules.captcha]"
|
|
||||||
type="text"
|
|
||||||
placeholder="手机短信验证码">
|
|
||||||
</a-input>
|
|
||||||
</a-col>
|
|
||||||
<a-col :span="8">
|
|
||||||
<a-button
|
|
||||||
tabindex="-1"
|
|
||||||
size="default"
|
|
||||||
:disabled="state.smsSendBtn"
|
|
||||||
@click.stop.prevent="getCaptcha"
|
|
||||||
v-text="!state.smsSendBtn && '获取验证码' || (state.time+' s')"></a-button>
|
|
||||||
</a-col>
|
|
||||||
</a-row>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
|
||||||
<router-link style="float: left;line-height: 40px;" :to="{ name: 'login' }">使用已有账户登录</router-link>
|
|
||||||
<a-button type="primary" @click="nextStep" style="margin-left: 20px">下一步</a-button>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {postAction} from '@/api/manage'
|
|
||||||
|
|
||||||
export default {
|
|
||||||
name: 'Step2',
|
|
||||||
props: ['userList'],
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
form: this.$form.createForm(this),
|
|
||||||
loading: false,
|
|
||||||
// accountName: this.userList.username,
|
|
||||||
dropList: '0',
|
|
||||||
captcha: '',
|
|
||||||
show: true,
|
|
||||||
state: {
|
|
||||||
time: 60,
|
|
||||||
smsSendBtn: false,
|
|
||||||
},
|
|
||||||
formLogin: {
|
|
||||||
captcha: '',
|
|
||||||
mobile: '',
|
|
||||||
},
|
|
||||||
validatorRules: {
|
|
||||||
captcha: {rule: [{required: true, message: '请输入短信验证码!'}, {validator: this.validateCaptcha}]},
|
|
||||||
phone: {rule: [{required: true, message: '请输入手机号码!'}, {validator: this.validatePhone}]},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
nextStep() {
|
|
||||||
let that = this
|
|
||||||
that.loading = true
|
|
||||||
this.form.validateFields((err, values) => {
|
|
||||||
console.log(values)
|
|
||||||
if (!err) {
|
|
||||||
if (that.dropList == '0') {
|
|
||||||
if (values.captcha == undefined) {
|
|
||||||
this.cmsFailed('请输入短信验证码!')
|
|
||||||
} else {
|
|
||||||
var params = {}
|
|
||||||
params.phone = values.phone
|
|
||||||
params.smscode = values.captcha
|
|
||||||
postAction('/sys/user/phoneVerification', params).then((res) => {
|
|
||||||
if (res.success) {
|
|
||||||
console.log(res)
|
|
||||||
var userList = {
|
|
||||||
username: res.result.username,
|
|
||||||
phone: values.phone,
|
|
||||||
smscode: res.result.smscode
|
|
||||||
}
|
|
||||||
setTimeout(function () {
|
|
||||||
that.$emit('nextStep', userList)
|
|
||||||
}, 0)
|
|
||||||
} else {
|
|
||||||
this.cmsFailed(res.message)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getCaptcha(e) {
|
|
||||||
e.preventDefault()
|
|
||||||
let that = this
|
|
||||||
let phone=that.form.getFieldValue('phone')
|
|
||||||
if(!phone){
|
|
||||||
this.cmsFailed('手机号不能为空!')
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.state.smsSendBtn = true
|
|
||||||
let interval = window.setInterval(() => {
|
|
||||||
if (that.state.time-- <= 0) {
|
|
||||||
that.state.time = 60
|
|
||||||
that.state.smsSendBtn = false
|
|
||||||
window.clearInterval(interval)
|
|
||||||
}
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
const hide = this.$message.loading('验证码发送中..', 0)
|
|
||||||
let smsParams = {
|
|
||||||
mobile: phone,
|
|
||||||
smsmode: '2'
|
|
||||||
}
|
|
||||||
postAction('/sys/sms', smsParams).then(res => {
|
|
||||||
if (!res.success) {
|
|
||||||
setTimeout(hide, 1)
|
|
||||||
this.cmsFailed(res.message)
|
|
||||||
}
|
|
||||||
setTimeout(hide, 500)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
cmsFailed(err) {
|
|
||||||
this.$notification['error']({
|
|
||||||
message: '验证错误',
|
|
||||||
description: err,
|
|
||||||
duration: 4,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
handleChangeSelect(value) {
|
|
||||||
var that = this
|
|
||||||
console.log(value)
|
|
||||||
if (value == 0) {
|
|
||||||
that.dropList = '0'
|
|
||||||
that.show = true
|
|
||||||
} else {
|
|
||||||
that.dropList = '1'
|
|
||||||
that.show = false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
validatePhone(rule,value,callback){
|
|
||||||
if(value){
|
|
||||||
var myreg=/^[1][3,4,5,7,8][0-9]{9}$/
|
|
||||||
if(!myreg.test(value)){
|
|
||||||
callback('请输入正确的手机号')
|
|
||||||
}else{
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
callback()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="less" scoped>
|
|
||||||
.stepFormText {
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
.ant-row{
|
|
||||||
margin-left: 0 !important;
|
|
||||||
margin-right: 0 !important;
|
|
||||||
}
|
|
||||||
.ant-col{
|
|
||||||
padding: 0 !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-form-item-label,
|
|
||||||
.ant-form-item-control {
|
|
||||||
line-height: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.getCaptcha {
|
|
||||||
display: block;
|
|
||||||
width: 100%;
|
|
||||||
height: 40px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
@@ -1,132 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<a-form :form="form" style="max-width: 500px; margin: 40px auto 0;">
|
|
||||||
<a-form-item
|
|
||||||
label="账号名"
|
|
||||||
:labelCol="{span: 5}"
|
|
||||||
:wrapperCol="{span: 19}"
|
|
||||||
>
|
|
||||||
<a-input
|
|
||||||
type="text"
|
|
||||||
autocomplete="false" :value="accountName" disabled>
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item
|
|
||||||
label="新密码"
|
|
||||||
:labelCol="{span: 5}"
|
|
||||||
:wrapperCol="{span: 19}"
|
|
||||||
class="stepFormText">
|
|
||||||
<a-input
|
|
||||||
v-decorator="['password',validatorRules.password]"
|
|
||||||
type="password"
|
|
||||||
autocomplete="false">
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item
|
|
||||||
label="确认密码"
|
|
||||||
:labelCol="{span: 5}"
|
|
||||||
:wrapperCol="{span: 19}"
|
|
||||||
class="stepFormText">
|
|
||||||
<a-input
|
|
||||||
v-decorator="['confirmPassword',validatorRules.confirmPassword]"
|
|
||||||
type="password"
|
|
||||||
autocomplete="false">
|
|
||||||
</a-input>
|
|
||||||
</a-form-item>
|
|
||||||
<a-form-item :wrapperCol="{span: 19, offset: 5}">
|
|
||||||
<a-button style="margin-left: 8px" @click="prevStep">上一步</a-button>
|
|
||||||
<a-button :loading="loading" type="primary" @click="nextStep" style="margin-left:20px">提交</a-button>
|
|
||||||
</a-form-item>
|
|
||||||
</a-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import {getAction } from '@/api/manage'
|
|
||||||
export default {
|
|
||||||
name: 'Step3',
|
|
||||||
// components: {
|
|
||||||
// Result
|
|
||||||
// },
|
|
||||||
props: ['userList'],
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
form: this.$form.createForm(this),
|
|
||||||
accountName: this.userList.username,
|
|
||||||
validatorRules: {
|
|
||||||
username: {rules: [{required: true, message: '用户名不能为空!'}]},
|
|
||||||
password: {
|
|
||||||
rules: [{
|
|
||||||
required: true,
|
|
||||||
pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,.\/]).{8,}$/,
|
|
||||||
message: '密码由8位数字、大小写字母和特殊符号组成!!'
|
|
||||||
}, {validator: this.handlePasswordLevel}]
|
|
||||||
},
|
|
||||||
confirmPassword: {rules: [{required: true, message: '密码不能为空!'}, {validator: this.handlePasswordCheck}]},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
nextStep () {
|
|
||||||
let that = this
|
|
||||||
that.loading = true
|
|
||||||
this.form.validateFields((err, values) => {
|
|
||||||
if ( !err ){
|
|
||||||
var params={}
|
|
||||||
params.username=this.userList.username
|
|
||||||
params.password=values.password
|
|
||||||
params.smscode=this.userList.smscode
|
|
||||||
params.phone= this.userList.phone
|
|
||||||
getAction('/sys/user/passwordChange', params).then((res) => {
|
|
||||||
if(res.success){
|
|
||||||
var userList = {
|
|
||||||
username: this.userList.username
|
|
||||||
}
|
|
||||||
console.log(userList)
|
|
||||||
setTimeout(function () {
|
|
||||||
that.$emit('nextStep', userList)
|
|
||||||
}, 1500)
|
|
||||||
}else{
|
|
||||||
this.passwordFailed(res.message)
|
|
||||||
that.loading = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else{
|
|
||||||
that.loading = false
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
},
|
|
||||||
prevStep () {
|
|
||||||
this.$emit('prevStep', this.userList)
|
|
||||||
},
|
|
||||||
|
|
||||||
handlePasswordCheck (rule, value, callback) {
|
|
||||||
let password = this.form.getFieldValue('password')
|
|
||||||
if (value && password && value.trim() !== password.trim()) {
|
|
||||||
callback(new Error('两次密码不一致'))
|
|
||||||
}
|
|
||||||
callback()
|
|
||||||
},
|
|
||||||
passwordFailed(err){
|
|
||||||
this.$notification[ 'error' ]({
|
|
||||||
message: '更改密码失败',
|
|
||||||
description:err,
|
|
||||||
duration: 4,
|
|
||||||
})
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style lang="less" scoped>
|
|
||||||
.stepFormText {
|
|
||||||
margin-bottom: 24px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.ant-form-item-label,
|
|
||||||
.ant-form-item-control {
|
|
||||||
line-height: 22px;
|
|
||||||
}
|
|
||||||
|
|
||||||
</style>
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div>
|
|
||||||
<a-form style="margin: 40px auto 0;">
|
|
||||||
<result title="更改密码成功" :is-success="true">
|
|
||||||
<div class="toLogin">
|
|
||||||
<h3>将在<span>{{time}}</span>秒后返回登录页面.</h3>
|
|
||||||
</div>
|
|
||||||
</result>
|
|
||||||
|
|
||||||
</a-form>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import Result from '@/views/result/Result'
|
|
||||||
export default {
|
|
||||||
name: 'Step4',
|
|
||||||
props:['userList'],
|
|
||||||
components: {
|
|
||||||
Result
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
loading: false,
|
|
||||||
time: 0,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
countDown(){
|
|
||||||
let that = this
|
|
||||||
that.time--
|
|
||||||
}
|
|
||||||
},
|
|
||||||
mounted(){
|
|
||||||
let that = this
|
|
||||||
that.time = 5
|
|
||||||
setInterval(that.countDown, 1000)
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
time: function (newVal) {
|
|
||||||
if (newVal == 0) {
|
|
||||||
var params = {
|
|
||||||
username: this.userList.username
|
|
||||||
}
|
|
||||||
this.$router.push({name: 'login', params})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<style scoped>
|
|
||||||
.toLogin{
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
Reference in New Issue
Block a user