authorization.js 528 B

1234567891011121314151617181920
  1. let LogIn = document.querySelector("#LogIn");
  2. let Password = document.querySelector("#Password");
  3. let Button = document.querySelector("button");
  4. if (Button) {
  5. Button.onclick = function () {
  6. if (LogIn && Password) {
  7. Sender.Go(postLogin, "/login", { Login: LogIn.value, Password: Password.value });
  8. }
  9. };
  10. }
  11. function postLogin(answer) {
  12. if (answer.Result && answer.Result == true) {
  13. alert("Привет, " + answer.Name);
  14. location.href = "/";
  15. } else {
  16. Notify.Show("Неверный логин/пароль");
  17. }
  18. }