Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data() {
- return {
- username: ""
- //window.onload = function(){
- //document.getElementsByName("login")[0].value
- //}
- ,
- password: ""
- }
- },
- methods: {
- authPost: function() {
- this.username = document.getElementsByName("login")[0].value;
- this.password = document.getElementsByName("pass")[0].value;
- /* axios.post('/user', {
- username: document.getElementsByName("login")[0].value,
- password: this.toMD5(this.document.getElementsByName("pass")[0].value)
- })
- .then(function (response) {
- console.log(response);
- })
- .catch(function (error) {
- console.log(error);
- }); */
- },
- toMD5(string) {
- var crypto = require('crypto');
- var hash = crypto.createHash('md5').update(string).digest('hex');
- return "md5"+hash;
- }
- },
- computed: {
- reversedMessage: function() {
- // `this` указывает на экземпляр vm
- console.log("comp")
- }
- },
- render (h) {
- return(
- <div id="zzz">
- <div class="logo">
- <img src="src/img/logo.png" class="logo-text"> </img>
- </div>
- <div class="calltoaction-text">Спиши время и будет тебе счастье!</div>
- <div class="auth-form">
- <input type="text" name="login" placeholder="Логин" />
- <br/>
- <input type="password" name="pass" placeholder="Пароль"/><br/>
- <button onClick={this.authPost} >ВОЙТИ</button>
- </div>
- <style jsx>{`
- `}</style>
- </div>
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement