| | |
| | | if (password === "") { |
| | | layer.tips('请输入密码', '#password', {tips: [4, '#ff0000']}); |
| | | return; |
| | | }else { |
| | | if(!checkPassword(password)){ |
| | | //密码必须包含字符和数字 |
| | | layer.tips('密码必须包含字符和数字长度不能少于8位,且不能包含连续数字和四位重复数字', '#password', {tips: [4, '#ff0000']}); |
| | | return ; |
| | | } |
| | | } |
| | | $.ajax({ |
| | | url: baseUrl+"/login.action", |
| | |
| | | localStorage.setItem("username", res.data.username); |
| | | localStorage.setItem("password", password); |
| | | window.location.href = "index.html"; |
| | | } else if (res.code === 10001) { |
| | | layer.tips(res.msg, '#username', {tips: [4, '#ff0000']}); |
| | | } else if (res.code === 10002) { |
| | | layer.tips(res.msg, '#username', {tips: [4, '#ff0000']}); |
| | | } else if (res.code === 10003) { |
| | | layer.tips(res.msg, '#password', {tips: [4, '#ff0000']}); |
| | | } else { |
| | | layer.tips(res.msg, '.login-btn', {tips: [3, '#ff0000']}); |
| | | } |