给登录和注册页面增加验证码的开关的功能
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="main">
|
<div class="main" :style="mainStyle">
|
||||||
<a-form :form="form" class="user-layout-login" ref="formLogin" id="formLogin">
|
<a-form :form="form" class="user-layout-login" ref="formLogin" id="formLogin">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</a-input-password>
|
</a-input-password>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-row :gutter="0">
|
<a-row :gutter="0" v-if="checkcodeFlag==='1'">
|
||||||
<a-col :span="14">
|
<a-col :span="14">
|
||||||
<a-form-item>
|
<a-form-item>
|
||||||
<a-input
|
<a-input
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
</router-link>
|
</router-link>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-form-item style="margin-top:16px">
|
<a-form-item :style="btnStyle">
|
||||||
<a-button
|
<a-button
|
||||||
size="large"
|
size="large"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -126,6 +126,9 @@
|
|||||||
uuid:'',
|
uuid:'',
|
||||||
randCodeImage:'',
|
randCodeImage:'',
|
||||||
registerFlag:'',
|
registerFlag:'',
|
||||||
|
checkcodeFlag:'',
|
||||||
|
mainStyle: '',
|
||||||
|
btnStyle: 'margin-top:16px',
|
||||||
requestCodeSuccess:false,
|
requestCodeSuccess:false,
|
||||||
checked: false
|
checked: false
|
||||||
}
|
}
|
||||||
@@ -137,6 +140,7 @@
|
|||||||
Vue.ls.remove(ACCESS_TOKEN)
|
Vue.ls.remove(ACCESS_TOKEN)
|
||||||
this.getRouterData()
|
this.getRouterData()
|
||||||
this.getRegisterFlag()
|
this.getRegisterFlag()
|
||||||
|
this.getCheckcodeFlag()
|
||||||
this.handleChangeCheckCode()
|
this.handleChangeCheckCode()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -346,6 +350,18 @@
|
|||||||
this.registerFlag = res + ''
|
this.registerFlag = res + ''
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getCheckcodeFlag(){
|
||||||
|
getAction('/platformConfig/getPlatform/checkcodeFlag').then((res) => {
|
||||||
|
this.checkcodeFlag = res + ''
|
||||||
|
if(this.checkcodeFlag === '1') {
|
||||||
|
this.mainStyle = ''
|
||||||
|
this.btnStyle = 'margin-top:16px'
|
||||||
|
} else {
|
||||||
|
this.mainStyle = 'padding-top:20px'
|
||||||
|
this.btnStyle = 'margin-top:26px'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
//获取密码加密规则
|
//获取密码加密规则
|
||||||
getEncrypte(){
|
getEncrypte(){
|
||||||
var encryptedString = Vue.ls.get(ENCRYPTED_STRING);
|
var encryptedString = Vue.ls.get(ENCRYPTED_STRING);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
<!-- b y 7 5 2 7 1 8 9 2 0 -->
|
||||||
<template>
|
<template>
|
||||||
<div class="main user-layout-register">
|
<div class="main user-layout-register" :style="mainStyle">
|
||||||
<a-form ref="formRegister" :autoFormCreate="(form)=>{this.form = form}" id="formRegister">
|
<a-form ref="formRegister" :autoFormCreate="(form)=>{this.form = form}" id="formRegister">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
fieldDecoratorId="username"
|
fieldDecoratorId="username"
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<a-input-password size="large" type="password" autocomplete="false" placeholder="确认密码"></a-input-password>
|
<a-input-password size="large" type="password" autocomplete="false" placeholder="确认密码"></a-input-password>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
<a-row :gutter="0">
|
<a-row :gutter="0" v-if="checkcodeFlag==='1'">
|
||||||
<a-col :span="14">
|
<a-col :span="14">
|
||||||
<a-form-item
|
<a-form-item
|
||||||
fieldDecoratorId="inputCode"
|
fieldDecoratorId="inputCode"
|
||||||
@@ -53,7 +53,7 @@
|
|||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
<a-form-item>
|
<a-form-item :style="btnStyle">
|
||||||
<a-button
|
<a-button
|
||||||
size="large"
|
size="large"
|
||||||
type="primary"
|
type="primary"
|
||||||
@@ -112,6 +112,9 @@
|
|||||||
form: null,
|
form: null,
|
||||||
uuid:'',
|
uuid:'',
|
||||||
randCodeImage:'',
|
randCodeImage:'',
|
||||||
|
checkcodeFlag:'',
|
||||||
|
mainStyle: '',
|
||||||
|
btnStyle: '',
|
||||||
requestCodeSuccess:false,
|
requestCodeSuccess:false,
|
||||||
state: {
|
state: {
|
||||||
time: 60,
|
time: 60,
|
||||||
@@ -136,9 +139,22 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
|
this.getCheckcodeFlag()
|
||||||
this.handleChangeCheckCode();
|
this.handleChangeCheckCode();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getCheckcodeFlag(){
|
||||||
|
getAction('/platformConfig/getPlatform/checkcodeFlag').then((res) => {
|
||||||
|
this.checkcodeFlag = res + ''
|
||||||
|
if(this.checkcodeFlag === '1') {
|
||||||
|
this.mainStyle = ''
|
||||||
|
this.btnStyle = ''
|
||||||
|
} else {
|
||||||
|
this.mainStyle = 'padding-top:20px'
|
||||||
|
this.btnStyle = 'margin-top:20px'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
handleChangeCheckCode(){
|
handleChangeCheckCode(){
|
||||||
this.currdatetime = new Date().getTime();
|
this.currdatetime = new Date().getTime();
|
||||||
getAction('/user/randomImage').then(res=>{
|
getAction('/user/randomImage').then(res=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user