You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
OneAuth/ui/page/auth/login.html

117 lines
2.4 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Login Page">
<title>{{ $t('auth.login') }}</title>
<style>
.login-title {
font-size: 24px;
font-weight: bold;
text-align: center;
margin-bottom: 20px;
color: var(--color-primary);
}
.form-group {
margin-bottom: 15px;
}
.form-label {
display: block;
margin-bottom: 5px;
font-weight: 500;
}
.form-input {
width: 100%;
padding: 10px;
border: 1px solid var(--border-color);
border-radius: var(--radius-md);
font-size: 14px;
}
.form-input:focus {
outline: none;
border-color: var(--color-primary);
}
.btn-submit {
width: 100%;
padding: 10px;
background-color: var(--color-primary);
color: white;
border: none;
border-radius: var(--radius-md);
cursor: pointer;
font-size: 16px;
transition: background 0.2s;
}
.btn-submit:hover {
background-color: var(--color-primary-hover);
}
.links {
margin-top: 15px;
text-align: center;
font-size: 14px;
}
.links a {
color: var(--color-primary);
text-decoration: none;
}
.error-msg {
color: var(--color-danger);
text-align: center;
margin-bottom: 10px;
font-size: 14px;
}
</style>
</head>
<body>
123
<h2 class="login-title">{{ $t('auth.login') }}</h2>
<div v-if="error" class="error-msg">{{ error }}</div>
<form @submit.prevent="handleLogin">
<div class="form-group">
<label class="form-label">{{ $t('auth.username') }}</label>
<input type="text" v:value="username" class="form-input" required>
</div>
<div class="form-group">
<label class="form-label">{{ $t('auth.password') }}</label>
<input type="password" v:value="password" class="form-input" required>
</div>
<button type="submit" class="btn-submit">{{ $t('auth.login') }}</button>
</form>
<div class="links">
<a href="/register">{{ $t('auth.register') }}</a>
</div>
</body>
<script setup>
username = "";
password = "";
error = "";
handleLogin = async (e) => {
e.preventDefault();
error = "";
try {
await $env.$vbase.login(username, password);
$router.push('/');
} catch (err) {
error = err.message || "Login failed";
}
};
</script>
</html>