|
|
@@ -4,7 +4,9 @@ |
|
|
|
<l-input v-model="oldPwd" title="旧密码" placeholder="请输入旧密码" password></l-input> |
|
|
|
<l-input v-model="newPwd" title="新的密码" placeholder="请输入新密码" password></l-input> |
|
|
|
<l-input v-model="confirmPwd" title="确认输入" placeholder="请再次输入新密码" password></l-input> |
|
|
|
|
|
|
|
<view class="passwordDes"> |
|
|
|
<text>新密码必须8-20位同时包含1.[大小写字母]、2.[数字]、3.[特殊符号!@#$%^&*]</text> |
|
|
|
</view> |
|
|
|
<view class="padding"> |
|
|
|
<l-button @click="submit" size="lg" color="blue" class="block" block>确认修改</l-button> |
|
|
|
</view> |
|
|
@@ -29,10 +31,15 @@ export default { |
|
|
|
this.CONFIRM('操作失败', '旧密码输入不正确,请重新确认') |
|
|
|
return |
|
|
|
} |
|
|
|
if (newPwd.length < 6 || newPwd.length > 16) { |
|
|
|
this.CONFIRM('操作失败', '新密码不符合要求,请修改后重试') |
|
|
|
return |
|
|
|
} |
|
|
|
// if (newPwd.length < 6 || newPwd.length > 16) { |
|
|
|
// this.CONFIRM('操作失败', '新密码不符合要求,请修改后重试') |
|
|
|
// return |
|
|
|
// } |
|
|
|
var reg = /^(?=.*[0-9])(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*,\.])[0-9a-zA-Z!@#$%^&*,\.]{8,20}$/; |
|
|
|
if( !reg.test(newPwd) ){ |
|
|
|
this.CONFIRM('操作失败', '新密码不符合要求,请修改后重试') |
|
|
|
return |
|
|
|
} |
|
|
|
if (newPwd !== confirmPwd) { |
|
|
|
this.CONFIRM('操作失败', '新密码和确认密码输入不一致,请修改') |
|
|
|
return |
|
|
@@ -41,12 +48,12 @@ export default { |
|
|
|
const success = await this.HTTP_POST( |
|
|
|
'learun/adms/user/modifypw', |
|
|
|
{ |
|
|
|
newpassword: this.md5(newPwd), |
|
|
|
oldpassword: this.md5(oldPwd) |
|
|
|
newpassword: this.MD5(newPwd), |
|
|
|
oldpassword: this.MD5(oldPwd) |
|
|
|
}, |
|
|
|
'未能成功修改密码' |
|
|
|
) |
|
|
|
|
|
|
|
console.log(success) |
|
|
|
if (!success) { |
|
|
|
return |
|
|
|
} |
|
|
@@ -57,3 +64,11 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style lang="scss"> |
|
|
|
.passwordDes{ |
|
|
|
color: #606266; |
|
|
|
font-size: 14px; |
|
|
|
padding: 8px; |
|
|
|
text-indent:2em; |
|
|
|
} |
|
|
|
</style> |