From 01323df92f2da52ab8322cfefa71a0a860602090 Mon Sep 17 00:00:00 2001 From: pawlaczyk Date: Thu, 10 Jan 2019 05:00:48 +0100 Subject: [PATCH] Logowanie i rejestracja bez snackbarow --- frontend/app/src/components/Navbar.vue | 3 +- frontend/app/src/views/Login.vue | 26 +++++--- frontend/app/src/views/Register.vue | 89 +++++++++++++++++++++++--- 3 files changed, 98 insertions(+), 20 deletions(-) diff --git a/frontend/app/src/components/Navbar.vue b/frontend/app/src/components/Navbar.vue index ec417d6..92c6dc2 100644 --- a/frontend/app/src/components/Navbar.vue +++ b/frontend/app/src/components/Navbar.vue @@ -48,7 +48,8 @@ - Wyloguj + Wyloguj + Zaloguj exit_to_app diff --git a/frontend/app/src/views/Login.vue b/frontend/app/src/views/Login.vue index 7fe11bb..ec871f5 100644 --- a/frontend/app/src/views/Login.vue +++ b/frontend/app/src/views/Login.vue @@ -14,14 +14,19 @@ - - - Zaloguj - - + + + + Zaloguj + + - Nie masz konta? Zarejestruj się! + +

+ Nie masz konta? Zarejestruj się! +

+
@@ -40,12 +45,14 @@ export default { userLogin : '', userPassword: '', loginRules: [ - v => v.length >= 0 || 'Pole nie może być puste' + v => v.length > 0 || 'Pole nie może być puste' ] //nie sprawdzam hasla, bo to przy rejestracji } }, methods:{ login(){ + if (this.$refs.form.validate()){ //valinnaj JS + axios.post("http://127.0.0.1:3000/api/loginUserView" , {"login": this.userLogin, "password": this.userPassword}, { crossdomain: true }) @@ -66,10 +73,9 @@ export default { .catch(error=>{ console.log("ERROR: ", error.response.data) }); + + }//dlugi if } - }, - goRegister(){ - console.log("Log register") } } diff --git a/frontend/app/src/views/Register.vue b/frontend/app/src/views/Register.vue index 6b85c28..1c76a91 100644 --- a/frontend/app/src/views/Register.vue +++ b/frontend/app/src/views/Register.vue @@ -9,15 +9,29 @@

Edżentelmeni

- - - + + + + + + + + - - + + Zarejestruj - + + + + +

+ Masz już konto? Zaloguj się! +

+
+
+
@@ -26,16 +40,73 @@