Files
UniVerse/frontend/src/views/auth/LoginView.vue
T
serega404 3b0bbfc858
🚀 Create and publish a Docker image / Detect changes in backend and frontend (push) Successful in 8s
🚀 Create and publish a Docker image / Build & publish backend image (push) Successful in 12s
🚀 Create and publish a Docker image / Build & publish frontend image (push) Successful in 25s
🚀 Create and publish a Docker image / Update stack on Portainer (push) Successful in 6s
feat: добавил svg иконки
2026-05-11 14:43:14 +03:00

124 lines
3.9 KiB
Vue

<script setup lang="ts">
import { ref } from 'vue'
import { useRoute } from 'vue-router'
import { useAuthStore } from '@/stores/auth'
import AppIcon from '@/components/ui/AppIcon.vue'
const auth = useAuthStore()
const route = useRoute()
const error = ref('')
const loading = ref(false)
if (typeof route.query.error === 'string') error.value = route.query.error
async function login() {
loading.value = true
error.value = ''
const ok = auth.startMicrosoftLogin()
loading.value = false
if (!ok) error.value = auth.error ?? 'Не удалось начать вход через Microsoft.'
}
</script>
<template>
<div class="login-bg">
<div class="login-card">
<div class="login-header">
<div class="logo-mark">
<AppIcon icon="world" :size="52" />
</div>
<h1 class="brand">UniVerse</h1>
<p class="brand-sub">«Откройте для себя вселенную знаний»</p>
</div>
<div class="login-desc">
UniVerse единая платформа ЮФУ для поиска, записи и участия в открытых межнаправленческих лекциях.
Получайте рекомендации, оставляйте отзывы и зарабатывайте монеты за полезную обратную связь.
</div>
<div class="login-actions">
<button class="btn-primary btn-full" type="button" :disabled="loading" @click="login">
<span v-if="loading" class="spinner-inline">
<span class="spinner"></span>
</span>
{{ loading ? 'Вход...' : 'Войти через ЮФУ (Microsoft Entra ID)' }}
</button>
<div class="error" v-if="error">
<AppIcon class="error-icon" icon="alert-triangle" :size="16" />
{{ error }}
</div>
</div>
<div class="login-footer">
Вход осуществляется через корпоративный аккаунт ЮФУ. При первом входе требуется подтверждение доступа.
</div>
</div>
</div>
</template>
<style scoped>
.login-bg {
min-height: 100vh;
background: var(--gradient-bg);
display: flex;
align-items: center;
justify-content: center;
padding: 24px;
}
.login-card {
width: 100%;
max-width: 520px;
background: rgba(255,255,255,0.82);
backdrop-filter: blur(20px);
border: 1px solid var(--color-border-glass);
border-radius: var(--radius-lg);
box-shadow: 0 32px 80px rgba(0,0,0,0.12);
padding: 40px 36px;
display: flex;
flex-direction: column;
gap: 20px;
}
.login-header { text-align: center; }
.logo-mark { display: inline-flex; justify-content: center; color: var(--color-text); }
.brand {
font-size: 34px;
font-weight: 900;
background: var(--gradient-brand);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin: 0;
}
.brand-sub { font-size: 14px; color: var(--color-text-secondary); margin: 6px 0 0; }
.login-desc {
font-size: 14px;
color: var(--color-text-secondary);
line-height: 1.5;
background: rgba(255,255,255,0.6);
border-radius: var(--radius-md);
padding: 14px 16px;
border: 1px solid var(--color-border-glass);
}
.login-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-full { width: 100%; justify-content: center; }
.error {
font-size: 13px;
color: var(--color-error);
background: rgba(239,68,68,0.1);
border: 1px solid rgba(239,68,68,0.3);
border-radius: var(--radius-sm);
padding: 8px 12px;
display: flex;
align-items: center;
gap: 8px;
}
.error-icon { color: var(--color-error); }
.login-footer {
text-align: center;
font-size: 12px;
color: var(--color-text-secondary);
}
.spinner-inline { display: inline-flex; margin-right: 6px; }
.spinner-inline .spinner { width: 16px; height: 16px; border-width: 2px; }
</style>