You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

55 lines
1.5 KiB

  1. $(".amend").click(function(){
  2. var old_pass = $("#old_pass").val();
  3. var new_pass = $("#new_pass").val();
  4. var again_pass = $("#again_pass").val();
  5. if(old_pass==""){
  6. window.wxc.xcConfirm("请输入原密码", window.wxc.xcConfirm.typeEnum.info);
  7. return false;
  8. }else if(new_pass==""){
  9. window.wxc.xcConfirm("请输入新密码", window.wxc.xcConfirm.typeEnum.info);
  10. return false;
  11. }else if(again_pass==""){
  12. window.wxc.xcConfirm("请重新输入新密码", window.wxc.xcConfirm.typeEnum.info);
  13. return false;
  14. }else if(again_pass!=new_pass){
  15. window.wxc.xcConfirm("两次密码输入不一致", window.wxc.xcConfirm.typeEnum.info);
  16. return false;
  17. }
  18. $.ajax({
  19. url:'./zz-fx/control.php', //请求地址
  20. type: "post", //请求方式
  21. data:{
  22. type:"distribut_ChangePassword",
  23. password:new_pass,
  24. passwordc:again_pass,
  25. password_old:old_pass
  26. },
  27. async:false,
  28. dataType: "json",
  29. success: function (data) {
  30. console.log(data);
  31. if(data.code == 0){
  32. setStorage("cutId",1);
  33. window.wxc.xcConfirm('密码修改成功,请重新登录!', window.wxc.xcConfirm.typeEnum.info,{
  34. onOk:function(){
  35. login_out();
  36. }
  37. });
  38. }
  39. },
  40. fail: function (date) {
  41. // 此处放失败后执行的代码
  42. }
  43. });
  44. })
  45. //设置字符串类型的本地缓存
  46. function setStorage(objName, objValue){
  47. var sto = window.localStorage;
  48. if (sto)
  49. sto.setItem(objName, objValue);
  50. }