Commit 80d815e3 by 伍思炜

bug修复

parent 7a35f0fc
......@@ -241,10 +241,10 @@
</style>
<!-- 全局配置 -->
<script>
window._CONFIG = {};
window._CONFIG['domianURL'] = 'http://localhost:8080/jeecg-boot';
window._CONFIG['imgDomainURL'] = 'http://localhost:8080/jeecg-boot/sys/common/view';
window._CONFIG['pdfDomainURL'] = 'http://localhost:8080/jeecg-boot/sys/common/pdf/pdfPreviewIframe';
// window._CONFIG = {};
// window._CONFIG['domianURL'] = 'http://localhost:8080/jeecg-boot';
// window._CONFIG['imgDomainURL'] = 'http://localhost:8080/jeecg-boot/sys/common/view';
// window._CONFIG['pdfDomainURL'] = 'http://localhost:8080/jeecg-boot/sys/common/pdf/pdfPreviewIframe';
</script>
</head>
......
......@@ -424,7 +424,7 @@
}
/deep/ .ant-form-item {
margin-bottom: 24vw / @vw;
margin-bottom: 12vw / @vw;
}
@media (min-width: 1920px) {
......@@ -448,7 +448,7 @@
/deep/ .user-layout-login div .ant-input {
width: 100%;
height: 68vw / @vw;
height: 58vw / @vw;
margin-bottom: 15vw / @vw;
padding-left: 44vw / @vw;
background: rgba(245, 245, 245, 1);
......
......@@ -35,14 +35,35 @@
</a-form-item>
</a-col>
<a-col :span="10">
<j-graphic-code @success="generateCode" style="float: right"></j-graphic-code>
</a-col>
</a-row>
<a-row :gutter="0">
<a-col :span="14">
<a-form-item>
<a-input
v-decorator="['phoneCode',validatorRules.phoneCode]"
size="large"
type="text"
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">
<a-button
size="small"
type="primary"
htmlType="submit"
class="code-button"
:loading="loginBtn"
@click.stop.prevent="getCode"
:disabled="loginBtn">{{codeMsg}}
:disabled="!loginBtn">{{codeMsg}}
</a-button>
<!-- <j-graphic-code @success="generateCode" style="float: right"></j-graphic-code>-->
</a-col>
......@@ -54,7 +75,7 @@
size="large"
type="password"
autocomplete="false"
placeholder="新密码(6-12位数字和字母组合)">
placeholder="新密码(6-12位数字+字母+字符组合)">
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
</a-input>
</a-form-item>
......@@ -76,9 +97,8 @@
type="primary"
htmlType="submit"
class="login-button"
:loading="loginBtn"
@click.stop.prevent="handleSubmit"
:disabled="loginBtn">确定
:disabled="!loginBtn">确定
</a-button>
</a-form>
......@@ -144,6 +164,7 @@ export default {
created() {
Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData();
console.log(this.loginBtn)
},
methods: {
// handler
......@@ -160,6 +181,10 @@ export default {
this.customActiveKey = key
// this.form.resetFields()
},
generateCode(value) {
this.loginBtn = false;
this.verifiedCode = value.toLowerCase()
},
getCode(){
// 验证码60秒倒计时
if (!this.timer) {
......@@ -194,6 +219,8 @@ export default {
}
},
handleSubmit() {
var space=/\s/;// 判断必须非空格
let that = this
let loginParams = {
......@@ -204,15 +231,24 @@ export default {
verificationCode:"",
newPwd:"",
rePwd:''
}
};
// 确定修改密码
that.form.validateFields(['username', 'password', 'password2', 'inputCode'], {force: true}, (err, values) => {
that.form.validateFields(['username', 'password', 'password2', 'phoneCode'], {force: true}, (err, values) => {
if(this.getLvl(values.password)){
this.registerRrror("密码需为6-12位字母+数字+字符组合")
return null;
}
if (/\s/.test(values.password)){
this.registerRrror("密码不能存在空格")
return null;
}
if (!err) {
values.password = encodeURIComponent(this.getPass(values.password));
values.password2 = encodeURIComponent(this.getPass(values.password2));
let data = {
account: values.username,
verificationCode: values.inputCode,
verificationCode: values.phoneCode,
newPwd: values.password,
rePwd: values.password
}
......@@ -227,6 +263,21 @@ export default {
})
},
getLvl(pwd) {
let lvl = 0;//默认是0级别
//密码中是否有数字,或者是字母,或者是特殊符号
if(/[0-9]/.test(pwd)){//如果有数字返回true,就让级别++变成1级了
lvl++;
}
if(/[a-zA-Z]/.test(pwd)){
lvl++;
}
if(/[^0-9a-zA-Z_]/.test(pwd)){
lvl++;
}
return lvl !== 3
},
requestFailed(err) {
this.$notification['error']({
message: '登录失败',
......@@ -260,9 +311,6 @@ export default {
callback("您输入的验证码不正确!");
}
},
inputCodeChange(e) {
},
getRouterData() {
this.$nextTick(() => {
this.form.setFieldsValue({
......@@ -270,6 +318,30 @@ export default {
});
})
},
inputCodeChange(e) {
this.inputCodeContent = e.target.value
if (!e.target.value || 0 == e.target.value) {
this.inputCodeNull = true
} else {
this.inputCodeContent = this.inputCodeContent.toLowerCase()
this.inputCodeNull = false
}
if (this.verifiedCode == this.inputCodeContent) {
this.form.validateFields(['username'], {force: true}, (err, values) => {
if (!err && this.countdown == 0) {
clearInterval(this.timer);
this.codeMsg = "获取验证码";
this.countdown = 60;
this.timer = null;
this.formLogin.username = values.username
this.getCode()
}
console.log(123)
this.loginBtn = true
})
}
},
validateToNextPassword (rule, value, callback) {
const form = this.form;
if (value!= form.getFieldValue("password")) {
......@@ -314,7 +386,7 @@ export default {
width: calc(100% - 666vw/@vw);
height: 792vw/@vw;
box-sizing: border-box;
padding:80vw/@vw 80vw/@vw 0 60vw/@vw;
padding:0 80vw/@vw 0 60vw/@vw;
float:left;
.form_title{
font-size:40vw/@vw;
......@@ -327,7 +399,7 @@ export default {
border-bottom: 6vw/@vw solid #57bbff;
}
/deep/ .ant-form-item{
margin-bottom: 24vw/@vw;
margin-bottom: 12vw/@vw;
}
@media (min-width: 1920px) {
/deep/.ant-input-affix-wrapper .ant-input-prefix{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment