|
@@ -51,7 +51,6 @@ $(function(){
|
|
|
var Suser=$('#Lo_user').val();
|
|
|
var Spass=$('#Lo_pass').val();
|
|
|
var check_experts=$('#checks').prop('checked');
|
|
|
- var experts=check_experts?0:1;
|
|
|
if(Suser==''||Spass==''){
|
|
|
msg('请填写用户名/密码.');
|
|
|
return false;
|
|
@@ -63,7 +62,6 @@ $(function(){
|
|
|
data: {
|
|
|
"username": Suser,
|
|
|
"password": Spass,
|
|
|
- "type": 0
|
|
|
},
|
|
|
success: function (rest) {
|
|
|
if (rest.error && rest.error.length) {
|
|
@@ -94,7 +92,7 @@ $(function(){
|
|
|
return ;
|
|
|
}
|
|
|
$('.smg').addClass('active');
|
|
|
- var lit = $('#msg').val(mess);
|
|
|
+ $('#msg').val(mess);
|
|
|
setTimeout(function () {
|
|
|
$('.smg').removeClass('active')
|
|
|
$('#msg').val('');
|
|
@@ -143,11 +141,12 @@ $(function(){
|
|
|
$("#new_password .fastener_right").click(function(){
|
|
|
$('#new_password .login_close').click();
|
|
|
});
|
|
|
+ let use_forget,phone_forget;
|
|
|
//点击忘记密码里面的确认,则发送一个请求,并跳转到重置密码界面
|
|
|
$('#forget_form').submit(function(e){
|
|
|
e.preventDefault();
|
|
|
- var use_forget = $('#forget_user').val();
|
|
|
- var phone_forget=$("#forget_phone").val();
|
|
|
+ use_forget = $('#forget_user').val();
|
|
|
+ phone_forget=$("#forget_phone").val();
|
|
|
var phone_n_forget=$("#photo_n").val();
|
|
|
if(!(use_forget).trim()){
|
|
|
msg('亲,请填写用户名')
|
|
@@ -161,18 +160,14 @@ $(function(){
|
|
|
msg('亲,请填写手机验证码')
|
|
|
return;
|
|
|
};
|
|
|
- // $('#forget').fadeOut(800);
|
|
|
- // $('#form_register').fadeOut(800);
|
|
|
- // $("#new_password").fadeIn(800);
|
|
|
- // $(".password_top>h4").attr("val",rest.data);
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
dataType: "json",
|
|
|
- url: globalConfig.context + "/open/checkMCode",
|
|
|
+ url: globalConfig.context + "/open/checkMNCode",
|
|
|
data: {
|
|
|
- user: use_forget,
|
|
|
- photo:phone_forget,
|
|
|
- "mobileCode": phone_n_forget
|
|
|
+ 'userName': use_forget,
|
|
|
+ 'mobile':phone_forget,
|
|
|
+ 'mobileCode': phone_n_forget
|
|
|
},
|
|
|
success: function (rest) {
|
|
|
if (rest.error && rest.error.length) {
|
|
@@ -186,69 +181,47 @@ $(function(){
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
- function pass_new(){
|
|
|
- $('#new_pass').blur(function () {
|
|
|
- var pass_pattern=/^[a-zA-Z\d_]{6,12}$/;
|
|
|
- var new_pass=$("#new_pass").val();
|
|
|
- var new_pass_again=$("#new_pass_again").val();
|
|
|
- if (new_pass==''||!pass_pattern.test(new_pass)) {
|
|
|
- $(this).val('');
|
|
|
- $(this).attr('placeholder', '请输入6-12位数密码');
|
|
|
- }
|
|
|
- if (new_pass!==new_pass_again) {
|
|
|
- $('#new_pass_again').val('')
|
|
|
- $('#new_pass_again').attr('placeholder', '确认密码')
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- pass_new();
|
|
|
- function pass_new_again(){
|
|
|
- //密码相同验证
|
|
|
- $('#new_pass_again').blur(function () {
|
|
|
- var new_pass=$("#new_pass").val();
|
|
|
- var new_pass_again=$("#new_pass_again").val();
|
|
|
- if (new_pass !== new_pass_again||new_pass_again == '') {
|
|
|
- $(this).val('');
|
|
|
- $(this).attr('placeholder', '确认密码')
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- pass_new_again()
|
|
|
//点击重置密码里面的确认,则发送一个请求,并关闭重置密码界面
|
|
|
$('#new_password_form').submit(function(e){
|
|
|
e.preventDefault();
|
|
|
- var pass_pattern=/^\w{6,12}$/;
|
|
|
- var phone_forget=$("#forget_phone").val();
|
|
|
+ var pass_pattern=/^[a-zA-Z0-9]{6,12}$/;
|
|
|
var new_pass=$("#new_pass").val();
|
|
|
var new_pass_again=$("#new_pass_again").val();
|
|
|
- var types = $('#forget_checks').prop("checked") ? '0' : '1';//团体/个人
|
|
|
var reset_code=$(".password_top>h4").attr("val");
|
|
|
- if(new_pass==''||!pass_pattern.test(new_pass)||new_pass!==new_pass_again){
|
|
|
- return false;
|
|
|
- }else {
|
|
|
- $.ajax({
|
|
|
- type: "post",
|
|
|
- dataType: "json",
|
|
|
- url: globalConfig.context + "/open/resetPwd",
|
|
|
- data: {
|
|
|
- "mobile": phone_forget,
|
|
|
- "type": types,
|
|
|
- "resetCode":reset_code,
|
|
|
- "newPwd": new_pass
|
|
|
- },
|
|
|
- success: function (rest) {
|
|
|
- if (rest.error && rest.error.length) {
|
|
|
- $('#msg').val(rest.error[0].message);
|
|
|
- msg();
|
|
|
- } else {
|
|
|
- $('.login').fadeIn(800);
|
|
|
- $('#form_register').fadeOut(800);
|
|
|
- $("#new_password").fadeOut(800);
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ console.log(new_pass,new_pass_again)
|
|
|
+ if(!new_pass||!new_pass_again){
|
|
|
+ msg('亲,新旧密码必填!')
|
|
|
+ return;
|
|
|
}
|
|
|
-
|
|
|
+ if(new_pass!==new_pass_again){
|
|
|
+ msg('亲,两次密码不一致')
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!pass_pattern.test(new_pass)){
|
|
|
+ msg('亲,密码格式不正确')
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ $.ajax({
|
|
|
+ type: "post",
|
|
|
+ dataType: "json",
|
|
|
+ url: globalConfig.context + "/open/resetPassword",
|
|
|
+ data: {
|
|
|
+ 'userName':use_forget,
|
|
|
+ "newPwd": new_pass,
|
|
|
+ 'mobile':phone_forget,
|
|
|
+ 'resetCode':reset_code
|
|
|
+ },
|
|
|
+ success: function (rest) {
|
|
|
+ if (rest.error && rest.error.length) {
|
|
|
+ msg(rest.error[0].message);
|
|
|
+ } else {
|
|
|
+ $('.login').fadeIn(800);
|
|
|
+ $('#form_register').fadeOut(800);
|
|
|
+ $("#new_password").fadeOut(800);
|
|
|
+ msg('修改成功!');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
});
|
|
|
//手机号码的验证
|
|
|
function photoyanzheng(){
|
|
@@ -275,17 +248,6 @@ $(function(){
|
|
|
})
|
|
|
}
|
|
|
photoyanzheng();
|
|
|
- //手机验证码
|
|
|
- function photo_n(){
|
|
|
- $('#photo_n').blur(function () {
|
|
|
- var phoa = $(this).val();
|
|
|
- if (phoa=='') {
|
|
|
- $(this).val('');
|
|
|
- $(this).attr('placeholder', '请输入验证码');
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- photo_n();
|
|
|
//点击刷新图片验证码
|
|
|
$('.yanzhengma_cont_').click(function () {
|
|
|
$('.yanzhengma_cont_ img').attr('src', (globalConfig.context + "/open/getVCode?t=" + Math.random()))
|
|
@@ -324,11 +286,9 @@ $(function(){
|
|
|
},
|
|
|
success: function (data) {
|
|
|
if (data.error && data.error.length) {
|
|
|
- $('#msg').val(data.error[0].message);
|
|
|
- msg();
|
|
|
+ msg(data.error[0].message);
|
|
|
} else {
|
|
|
- $('#msg').val('发送成功');
|
|
|
- msg();
|
|
|
+ msg('发送成功');
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -337,8 +297,8 @@ $(function(){
|
|
|
//loading
|
|
|
loading();
|
|
|
function loading(){
|
|
|
- clearInterval(setTime);
|
|
|
- let txt = "loading...",htmls=[],i=0,
|
|
|
+ clearInterval(setTime)
|
|
|
+ let txt = "努力加载中...",htmls=[],i=0,
|
|
|
txtArr = txt.split('');
|
|
|
let ps = document.createElement('p');
|
|
|
txtArr.map(item=>{
|
|
@@ -355,7 +315,7 @@ $(function(){
|
|
|
}
|
|
|
$('.loading p span').eq(i).addClass('active').siblings().removeClass('active');
|
|
|
}
|
|
|
- let setTime =setInterval(()=>{active()},100);
|
|
|
+ var setTime =setInterval(()=>{active()},100);
|
|
|
}
|
|
|
});
|
|
|
|