Commit 656ee394 authored by TTS Kieu Tuan Anh's avatar TTS Kieu Tuan Anh

add footer + fix delay login

parent 30643861
<template>
<footer id="container">
<div id="contacts">
<div id="contacts--contact">
<p> xavier.seignard+drangies@gmail.com </p>
<p>+84965615899</p>
</div>
<div id="contacts--social">
<div></div>
<div></div>
<div></div>
</div>
</div>
<div id="mentions">
<p> 2018 | mentions légales</p>
</div>
</footer>
</template>
<script>
export default {
name: "Footer",
};
</script>
<style>
#container{
min-height: calc(100vh - 40px);
padding-top:20px;
margin-top:20px;
width:100vw;
color:white;
background-color:#17a2b8;
display:flex;
flex-direction:column;
align-items:center;
}
#contacts{
display:flex;
justify-content:space-around;
align-items:center;
width:100%;
}
#contacts--contact{
text-align:right;
}
#contacts--social{
width:20%;
display : flex;
justify-content : space-between;
}
#contacts--social div{
height:30px;
width:30px;
background-color:white;
border-radius:50%;
}
#mentions p {
font-size:0.5em;
}
</style>
\ No newline at end of file
......@@ -6,6 +6,10 @@
<style>
.nuxt-logo {
height: 180px;
height: 20%;
display: block;
margin-left: auto;
margin-right: auto;
margin-bottom: 15px;
}
</style>
<template>
<svg class="nuxt-logo" viewBox="0 0 45 30" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M24.7203 29.704H41.1008C41.6211 29.7041 42.1322 29.5669 42.5828 29.3061C43.0334 29.0454 43.4075 28.6704 43.6675 28.2188C43.9275 27.7672 44.0643 27.2549 44.0641 26.7335C44.0639 26.2121 43.9266 25.6999 43.6662 25.2485L32.6655 6.15312C32.4055 5.70162 32.0315 5.32667 31.581 5.06598C31.1305 4.8053 30.6195 4.66805 30.0994 4.66805C29.5792 4.66805 29.0682 4.8053 28.6177 5.06598C28.1672 5.32667 27.7932 5.70162 27.5332 6.15312L24.7203 11.039L19.2208 1.48485C18.9606 1.03338 18.5864 0.658493 18.1358 0.397853C17.6852 0.137213 17.1741 0 16.6538 0C16.1336 0 15.6225 0.137213 15.1719 0.397853C14.7213 0.658493 14.3471 1.03338 14.0868 1.48485L0.397874 25.2485C0.137452 25.6999 0.000226653 26.2121 2.8053e-07 26.7335C-0.000226092 27.2549 0.136554 27.7672 0.396584 28.2188C0.656614 28.6704 1.03072 29.0454 1.48129 29.3061C1.93185 29.5669 2.44298 29.7041 2.96326 29.704H13.2456C17.3195 29.704 20.3239 27.9106 22.3912 24.4118L27.4102 15.7008L30.0986 11.039L38.1667 25.0422H27.4102L24.7203 29.704ZM13.0779 25.0374L5.9022 25.0358L16.6586 6.36589L22.0257 15.7008L18.4322 21.9401C17.0593 24.2103 15.4996 25.0374 13.0779 25.0374Z" fill="#00DC82" />
</svg>
</template>
\ No newline at end of file
......@@ -13,28 +13,10 @@
<!-- Right aligned nav items -->
<b-navbar-nav class="ml-auto">
<b-nav-form>
<b-form-input
size="sm"
class="mr-sm-2"
placeholder="Search"
></b-form-input>
<b-button size="sm" class="my-2 my-sm-0" type="submit"
>Search</b-button
>
</b-nav-form>
<b-nav-item-dropdown text="Lang" right>
<b-dropdown-item href="#">EN</b-dropdown-item>
<b-dropdown-item href="#">ES</b-dropdown-item>
<b-dropdown-item href="#">RU</b-dropdown-item>
<b-dropdown-item href="#">FA</b-dropdown-item>
</b-nav-item-dropdown>
<b-nav-item-dropdown right>
<!-- Using 'button-content' slot -->
<template #button-content>
<em>User</em>
<em>{{ $auth.$storage.getUniversal('userName')}}</em>
</template>
<b-dropdown-item href="#">Profile</b-dropdown-item>
<b-dropdown-item href="#" @click="logout">Sign Out</b-dropdown-item>
......@@ -50,7 +32,8 @@ export default {
};
</script>
<script>
import Sidebar from "@/components/sidebar";
import sidebar from "@/components/sidebar";
import vuex from
export default {
components: { sidebar },
......@@ -68,7 +51,7 @@ export default {
"Content-Type": "application/json",
},
body: JSON.stringify({
token: token_access,
token: this.$auth.$storage.getUniversal('token'),
}),
});
localStorage.removeItem("token");
......
<template>
<div>
<div>
<Nav />
<h1 style="text-align: center;">HOME</h1>
<h1 style="text-align: center">HOME</h1>
</div>
</template>
<script>
import { onMounted } from 'vue';
import axios from 'axios';
import VueAxios from 'vue-axios';
</div>
</template>
import Nav from "@/components/Nav";
<script>
import { onMounted } from "vue";
import axios from "axios";
import VueAxios from "vue-axios";
import Nav from "@/components/Nav";
import Footer from "@/components/footer";
export default {
components: { Nav },
components: { Footer },
};
this.$router.go()
</script>
// export default {
// name: "Home",
// data() {
// return {
// users: [],
// }
// },
// setup() {
// onMounted(async ()=> {
// await fetch('http://localhost:3000/api/login', {
// method: 'GET',
// headers: {'Content-Type': 'application/json'},
// data: Response.data,
// credentials: 'include',
// });
// })
// }
// }
// </script>
// <script>
// console.log(data);
</script>
<!-- <script>
export default {
middleware: "web"
}
</script> -->
<style>
</style>
<style></style>
......@@ -13,7 +13,7 @@
>
<div id="form-login">
<form @submit.prevent="login">
<h1 class="h3 mb-2 fw-normal" style="text-align: center">Sign In</h1>
<NuxtLogo />
<input
id="email"
v-model="email"
......@@ -52,11 +52,12 @@
<script>
import Nav from "@/components/Nav";
import Notification from "@/components/Notification";
import notification from "@/components/notification";
export default {
components: { Nav },
components: { Notification },
components: { notification },
components: { NuxtLogo },
};
</script>
<script>
......@@ -88,6 +89,8 @@ export default {
});
console.log(resp.status);
localStorage.setItem("token", resp.data.bearer_token);
this.$auth.$storage.setUniversal("token", resp.data.bearer_token);
this.$auth.$storage.setUniversal("userName", resp.data.name);
if (resp.status == "success") {
this.$router.push("home");
}
......@@ -110,6 +113,22 @@ export default {
// this.error = 'Username or Password not valid'
// }
},
checkForm: function (e) {
if (this.name && this.age) {
return true;
}
this.errors = [];
if (!this.name) {
this.errors.push('Name required.');
}
if (!this.age) {
this.errors.push('Age required.');
}
e.preventDefault();
}
},
};
</script>
......
import { LocalScheme } from '~auth/runtime'
export default class CustomScheme extends LocalScheme {
// Override `fetchUser` method of `local` scheme
async fetchUser (endpoint) {
// Token is required but not available
if (!this.check().valid) {
return
}
// User endpoint is disabled.
if (!this.options.endpoints.user) {
this.$auth.setUser({})
return
}
// Try to fetch user and then set
return this.$auth.requestWith(
this.name,
endpoint,
this.options.endpoints.user
).then((response) => {
const user = getProp(response.data, this.options.user.property)
// Transform the user object
const customUser = {
...user,
fullName: user.firstName + ' ' + user.lastName,
roles: ['user']
}
// Set the custom user
// The `customUser` object will be accessible through `this.$auth.user`
// Like `this.$auth.user.fullName` or `this.$auth.user.roles`
this.$auth.setUser(customUser)
return response
}).catch((error) => {
this.$auth.callOnError(error, { method: 'fetchUser' })
})
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment