Advertisement
Guest User

Untitled

a guest
Jan 31st, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. data() {
  2. return {
  3. username: ""
  4. //window.onload = function(){
  5. //document.getElementsByName("login")[0].value
  6. //}
  7. ,
  8. password: ""
  9. }
  10. },
  11. methods: {
  12. authPost: function() {
  13. this.username = document.getElementsByName("login")[0].value;
  14. this.password = document.getElementsByName("pass")[0].value;
  15. /* axios.post('/user', {
  16. username: document.getElementsByName("login")[0].value,
  17. password: this.toMD5(this.document.getElementsByName("pass")[0].value)
  18. })
  19. .then(function (response) {
  20. console.log(response);
  21. })
  22. .catch(function (error) {
  23. console.log(error);
  24. }); */
  25. },
  26. toMD5(string) {
  27. var crypto = require('crypto');
  28. var hash = crypto.createHash('md5').update(string).digest('hex');
  29. return "md5"+hash;
  30. }
  31. },
  32. computed: {
  33. reversedMessage: function() {
  34. // `this` указывает на экземпляр vm
  35. console.log("comp")
  36. }
  37. },
  38. render (h) {
  39. return(
  40. <div id="zzz">
  41. <div class="logo">
  42. <img src="src/img/logo.png" class="logo-text"> </img>
  43. </div>
  44. <div class="calltoaction-text">Спиши время и будет тебе счастье!</div>
  45.  
  46. <div class="auth-form">
  47. <input type="text" name="login" placeholder="Логин" />
  48. <br/>
  49. <input type="password" name="pass" placeholder="Пароль"/><br/>
  50. <button onClick={this.authPost} >ВОЙТИ</button>
  51. </div>
  52. <style jsx>{`
  53.  
  54. `}</style>
  55. </div>
  56.  
  57. );
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement