Commit 80d815e3 by 伍思炜

bug修复

parent 7a35f0fc
...@@ -241,10 +241,10 @@ ...@@ -241,10 +241,10 @@
</style> </style>
<!-- 全局配置 --> <!-- 全局配置 -->
<script> <script>
window._CONFIG = {}; // window._CONFIG = {};
window._CONFIG['domianURL'] = 'http://localhost:8080/jeecg-boot'; // window._CONFIG['domianURL'] = 'http://localhost:8080/jeecg-boot';
window._CONFIG['imgDomainURL'] = 'http://localhost:8080/jeecg-boot/sys/common/view'; // 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['pdfDomainURL'] = 'http://localhost:8080/jeecg-boot/sys/common/pdf/pdfPreviewIframe';
</script> </script>
</head> </head>
......
...@@ -424,7 +424,7 @@ ...@@ -424,7 +424,7 @@
} }
/deep/ .ant-form-item { /deep/ .ant-form-item {
margin-bottom: 24vw / @vw; margin-bottom: 12vw / @vw;
} }
@media (min-width: 1920px) { @media (min-width: 1920px) {
...@@ -448,7 +448,7 @@ ...@@ -448,7 +448,7 @@
/deep/ .user-layout-login div .ant-input { /deep/ .user-layout-login div .ant-input {
width: 100%; width: 100%;
height: 68vw / @vw; height: 58vw / @vw;
margin-bottom: 15vw / @vw; margin-bottom: 15vw / @vw;
padding-left: 44vw / @vw; padding-left: 44vw / @vw;
background: rgba(245, 245, 245, 1); background: rgba(245, 245, 245, 1);
......
...@@ -35,14 +35,35 @@ ...@@ -35,14 +35,35 @@
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="10"> <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 <a-button
size="small" size="small"
type="primary" type="primary"
htmlType="submit" htmlType="submit"
class="code-button" class="code-button"
:loading="loginBtn"
@click.stop.prevent="getCode" @click.stop.prevent="getCode"
:disabled="loginBtn">{{codeMsg}} :disabled="!loginBtn">{{codeMsg}}
</a-button> </a-button>
<!-- <j-graphic-code @success="generateCode" style="float: right"></j-graphic-code>--> <!-- <j-graphic-code @success="generateCode" style="float: right"></j-graphic-code>-->
</a-col> </a-col>
...@@ -54,7 +75,7 @@ ...@@ -54,7 +75,7 @@
size="large" size="large"
type="password" type="password"
autocomplete="false" autocomplete="false"
placeholder="新密码(6-12位数字和字母组合)"> placeholder="新密码(6-12位数字+字母+字符组合)">
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/> <a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }"/>
</a-input> </a-input>
</a-form-item> </a-form-item>
...@@ -76,9 +97,8 @@ ...@@ -76,9 +97,8 @@
type="primary" type="primary"
htmlType="submit" htmlType="submit"
class="login-button" class="login-button"
:loading="loginBtn"
@click.stop.prevent="handleSubmit" @click.stop.prevent="handleSubmit"
:disabled="loginBtn">确定 :disabled="!loginBtn">确定
</a-button> </a-button>
</a-form> </a-form>
...@@ -144,6 +164,7 @@ export default { ...@@ -144,6 +164,7 @@ export default {
created() { created() {
Vue.ls.remove(ACCESS_TOKEN) Vue.ls.remove(ACCESS_TOKEN)
this.getRouterData(); this.getRouterData();
console.log(this.loginBtn)
}, },
methods: { methods: {
// handler // handler
...@@ -160,6 +181,10 @@ export default { ...@@ -160,6 +181,10 @@ export default {
this.customActiveKey = key this.customActiveKey = key
// this.form.resetFields() // this.form.resetFields()
}, },
generateCode(value) {
this.loginBtn = false;
this.verifiedCode = value.toLowerCase()
},
getCode(){ getCode(){
// 验证码60秒倒计时 // 验证码60秒倒计时
if (!this.timer) { if (!this.timer) {
...@@ -194,6 +219,8 @@ export default { ...@@ -194,6 +219,8 @@ export default {
} }
}, },
handleSubmit() { handleSubmit() {
var space=/\s/;// 判断必须非空格
let that = this let that = this
let loginParams = { let loginParams = {
...@@ -204,15 +231,24 @@ export default { ...@@ -204,15 +231,24 @@ export default {
verificationCode:"", verificationCode:"",
newPwd:"", newPwd:"",
rePwd:'' 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) { if (!err) {
values.password = encodeURIComponent(this.getPass(values.password)); values.password = encodeURIComponent(this.getPass(values.password));
values.password2 = encodeURIComponent(this.getPass(values.password2)); values.password2 = encodeURIComponent(this.getPass(values.password2));
let data = { let data = {
account: values.username, account: values.username,
verificationCode: values.inputCode, verificationCode: values.phoneCode,
newPwd: values.password, newPwd: values.password,
rePwd: values.password rePwd: values.password
} }
...@@ -227,6 +263,21 @@ export default { ...@@ -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) { requestFailed(err) {
this.$notification['error']({ this.$notification['error']({
message: '登录失败', message: '登录失败',
...@@ -260,9 +311,6 @@ export default { ...@@ -260,9 +311,6 @@ export default {
callback("您输入的验证码不正确!"); callback("您输入的验证码不正确!");
} }
}, },
inputCodeChange(e) {
},
getRouterData() { getRouterData() {
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue({ this.form.setFieldsValue({
...@@ -270,6 +318,30 @@ export default { ...@@ -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) { validateToNextPassword (rule, value, callback) {
const form = this.form; const form = this.form;
if (value!= form.getFieldValue("password")) { if (value!= form.getFieldValue("password")) {
...@@ -314,7 +386,7 @@ export default { ...@@ -314,7 +386,7 @@ export default {
width: calc(100% - 666vw/@vw); width: calc(100% - 666vw/@vw);
height: 792vw/@vw; height: 792vw/@vw;
box-sizing: border-box; box-sizing: border-box;
padding:80vw/@vw 80vw/@vw 0 60vw/@vw; padding:0 80vw/@vw 0 60vw/@vw;
float:left; float:left;
.form_title{ .form_title{
font-size:40vw/@vw; font-size:40vw/@vw;
...@@ -327,7 +399,7 @@ export default { ...@@ -327,7 +399,7 @@ export default {
border-bottom: 6vw/@vw solid #57bbff; border-bottom: 6vw/@vw solid #57bbff;
} }
/deep/ .ant-form-item{ /deep/ .ant-form-item{
margin-bottom: 24vw/@vw; margin-bottom: 12vw/@vw;
} }
@media (min-width: 1920px) { @media (min-width: 1920px) {
/deep/.ant-input-affix-wrapper .ant-input-prefix{ /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