refactor login page and add user avatar to header

This commit is contained in:
kandrusyak
2023-07-28 02:18:56 +03:00
parent eced313580
commit 2120cba2e9
4 changed files with 34 additions and 42 deletions

View File

@@ -33,7 +33,7 @@ export default {
return {
isOpenForm: false,
updatedClients: false,
url: "https://astra-dev.dopcore.com",
url: "https://astra-dev.dopcore.com/api/store/",
createdClientId: "",
};
},

View File

@@ -34,9 +34,9 @@
padding="0",
style="color: var(--font-grey-color)"
)
base-avatar(:size="36", :color="userData?.color", v-if="!userData?.photo") {{changeName}}
base-avatar(:size="36", :color="userData?.color", v-if="!userData?.avatar") {{changeName}}
base-avatar(:size="32", v-else)
img.h-full.object-cover(:src="url + userData?.photo", alt="Avatar")
img.h-full.object-cover(:src="url + userData?.avatar", alt="Avatar")
.h-6.w-6.flex.items-center.justify-center.ml-1.pt-1
q-icon.arrow(name="app:down-arrow", size="24px")
q-menu(
@@ -104,8 +104,8 @@ export default {
redirectHomePage() {
this.$router.push("/calendar");
},
logout() {
localStorage.removeItem("tokenAccess");
async logout() {
await fetchWrapper.post("auth/logout");
this.$router.go("/login");
},
openPopup() {

View File

@@ -24,11 +24,14 @@
:shadow-text="shadowText",
:autofocus="autofocus",
hide-bottom-space
:error="error"
)
template(v-slot:prepend, v-if="iconLeft")
slot(name="iconLeft")
template(v-slot:append, v-if="iconRight")
slot(name="iconRight")
template(#error v-if="error")
slot(name="error")
slot(v-if="!iconLeft && !iconRight")
</template>
@@ -80,6 +83,7 @@ export default {
size: String,
circle: Boolean,
height: String,
error: Boolean,
},
emits: ["update:modelValue"],
computed: {