|
|
<template>
|
|
|
<div class="login-container">
|
|
|
<h2>用户登录</h2>
|
|
|
|
|
|
<form @submit.prevent="submitForm">
|
|
|
|
|
|
<div class="form-group">
|
|
|
<label for="username">用户名/邮箱:</label>
|
|
|
<input
|
|
|
type="text"
|
|
|
id="username"
|
|
|
v-model="username"
|
|
|
placeholder="请输入用户名或邮箱"
|
|
|
required
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
<label for="password">密码:</label>
|
|
|
<input
|
|
|
type="password"
|
|
|
id="password"
|
|
|
v-model="password"
|
|
|
placeholder="请输入密码"
|
|
|
required
|
|
|
/>
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div v-if="errorMessage" class="error-message">
|
|
|
{{ errorMessage }}
|
|
|
</div>
|
|
|
|
|
|
|
|
|
<div class="form-group">
|
|
|
<button type="submit">登录</button>
|
|
|
</div>
|
|
|
|
|
|
<div class="register-link">
|
|
|
<p>还没有账号?<router-link to="/register">注册</router-link></p>
|
|
|
</div>
|
|
|
</form>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
username: "",
|
|
|
password: "",
|
|
|
errorMessage: "",
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
submitForm() {
|
|
|
|
|
|
this.errorMessage = "";
|
|
|
|
|
|
|
|
|
this.$router.push('/decision-list');
|
|
|
},
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
|
body {
|
|
|
background: linear-gradient(to right, #6a11cb, #2575fc);
|
|
|
font-family: 'Arial', sans-serif;
|
|
|
}
|
|
|
|
|
|
|
|
|
.login-container {
|
|
|
max-width: 400px;
|
|
|
margin: 100px auto;
|
|
|
padding: 30px;
|
|
|
border-radius: 10px;
|
|
|
box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
|
|
|
background-color: white;
|
|
|
text-align: center;
|
|
|
}
|
|
|
|
|
|
|
|
|
h2 {
|
|
|
font-size: 24px;
|
|
|
color: #333;
|
|
|
margin-bottom: 30px;
|
|
|
font-weight: 600;
|
|
|
}
|
|
|
|
|
|
|
|
|
.form-group {
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
|
|
|
label {
|
|
|
font-size: 14px;
|
|
|
color: #555;
|
|
|
margin-bottom: 8px;
|
|
|
display: block;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
|
|
|
|
|
|
input {
|
|
|
width: 100%;
|
|
|
padding: 12px;
|
|
|
font-size: 16px;
|
|
|
border: 1px solid #ccc;
|
|
|
border-radius: 6px;
|
|
|
margin-top: 5px;
|
|
|
box-sizing: border-box;
|
|
|
transition: all 0.3s ease;
|
|
|
}
|
|
|
|
|
|
|
|
|
input:focus {
|
|
|
border-color: #2575fc;
|
|
|
box-shadow: 0 0 5px rgba(37, 117, 252, 0.5);
|
|
|
outline: none;
|
|
|
}
|
|
|
|
|
|
|
|
|
button {
|
|
|
width: 100%;
|
|
|
padding: 12px;
|
|
|
font-size: 16px;
|
|
|
background-color: #2575fc;
|
|
|
color: white;
|
|
|
border: none;
|
|
|
border-radius: 6px;
|
|
|
cursor: pointer;
|
|
|
transition: all 0.3s ease;
|
|
|
}
|
|
|
|
|
|
button:hover {
|
|
|
background-color: #1d61d6;
|
|
|
transform: translateY(-2px);
|
|
|
}
|
|
|
|
|
|
|
|
|
.error-message {
|
|
|
color: red;
|
|
|
font-size: 14px;
|
|
|
margin-top: 10px;
|
|
|
}
|
|
|
|
|
|
|
|
|
.register-link {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.register-link a {
|
|
|
color: #2575fc;
|
|
|
font-size: 14px;
|
|
|
text-decoration: none;
|
|
|
font-weight: 500;
|
|
|
}
|
|
|
|
|
|
.register-link a:hover {
|
|
|
text-decoration: underline;
|
|
|
}
|
|
|
|
|
|
.profile-container {
|
|
|
display: flex;
|
|
|
}
|
|
|
|
|
|
.sidebar {
|
|
|
width: 250px;
|
|
|
padding: 20px;
|
|
|
background-color: #f4f4f4;
|
|
|
}
|
|
|
|
|
|
.profile-main {
|
|
|
flex-grow: 1;
|
|
|
padding: 20px;
|
|
|
}
|
|
|
|
|
|
.profile-header {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
margin-bottom: 20px;
|
|
|
}
|
|
|
|
|
|
.profile-header .avatar {
|
|
|
width: 50px;
|
|
|
height: 50px;
|
|
|
border-radius: 50%;
|
|
|
margin-right: 20px;
|
|
|
}
|
|
|
|
|
|
.logout-button {
|
|
|
margin-top: 20px;
|
|
|
}
|
|
|
|
|
|
.logout-button button {
|
|
|
padding: 10px 20px;
|
|
|
background-color: #ff4444;
|
|
|
color: white;
|
|
|
border: none;
|
|
|
border-radius: 5px;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
|
|
|
.logout-button button:hover {
|
|
|
background-color: #ff0000;
|
|
|
}
|
|
|
|
|
|
</style>
|
|
|
|