login.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. $(document).ready(function () {
  2. var yanzheng = false;
  3. // console.log(parseFloat('1px'))
  4. var SlideVerifyPlug = window.slideVerifyPlug;
  5. var slideVerify2 = new SlideVerifyPlug("#verify-wrap2", {
  6. wrapWidth: "352px",
  7. initText: "滑动解锁",
  8. sucessText: "验证通过",
  9. getSuccessState: function (res) {
  10. console.log(res);
  11. yanzheng = res;
  12. },
  13. });
  14. //登录
  15. $(".LoginContainerInputLanding").on("click", function () {
  16. if (!yanzheng) {
  17. alert("请滑动验证后重试");
  18. } else {
  19. $.ajax({
  20. type: "post",
  21. url: "https://api.9169kkxstzsjkdd222.app/Admin/Login/loginAdmin",
  22. dataType: "json",
  23. data: {
  24. //async: false,
  25. username: $(".LoginContainerInputAcconuntBox").val(),
  26. password: $(".LoginContainerInputPasswordBox").val(),
  27. },
  28. success: function (res) {
  29. console.log(res);
  30. if (res.code == "200") {
  31. // alert("登陆成功")
  32. window.location.href = "https://api.9169kkxstzsjkdd222.app/slgj"
  33. } else if (res.code == "201") {
  34. alert("用户名或者密码错误")
  35. } else if (res.code == "203") {
  36. alert("用户名或者密码不能为空")
  37. }
  38. },
  39. })
  40. }
  41. });
  42. })