| | |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let level = localStorage.getItem(_href + 'pwdlevel') |
| | | |
| | | if (level && process.env.NODE_ENV === 'production') { |
| | | let visible = false |
| | | let tip = '密码强度不够,请修改密码!' |
| | | if (param.password.length < 8) { |
| | | visible = true |
| | | } else if (level === 'letter_num' && /^([^0-9]*|[^a-zA-Z]*)$/.test(param.password)) { |
| | | visible = true |
| | | } else if ((level === 'char_num' || level === 'char_num_90' || level === 'char_num_90_sms') && /^([^0-9]*|[^a-zA-Z]*|[^!@#$%^&*()_]*)$/.test(param.password)) { |
| | | visible = true |
| | | } else if ((level === 'char_num_90' || level === 'char_num_90_sms') && res.modifydate) { |
| | | let s = (new Date().getTime() - new Date(res.modifydate).getTime()) / (1000 * 24 * 60 * 60) |
| | | if (!isNaN(s) && s > 90) { |
| | | visible = true |
| | | tip = '您已90天未修改密码,请更换密码后使用!' |
| | | } |
| | | } |
| | | |
| | | if (visible) { |
| | | message.warning(tip) |
| | | this.setState({ |
| | | isDisabled: false, |
| | | visible: true |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | Api.loginAndRedirect(_param).then(result => { |