This commit is contained in:
loveuer 2025-05-09 11:22:27 +08:00
parent 0e984c46b4
commit e5cf2c1367
4 changed files with 102 additions and 83 deletions

View File

@ -1,13 +1,23 @@
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <!-- Emoji 图标方案 -->
<link rel="icon"
href="data:image/svg+xml,
<svg xmlns='http://www.w3.org/2000/svg'
viewBox='0 0 100 100'>
<text y='.9em'
font-size='90'
style='font-family: Arial, sans-serif'>
🗃️
</text>
</svg>">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>UShare</title> <title>UShare</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script type="module" src="/src/main.tsx"></script> <script type="module" src="/src/main.tsx"></script>
</body> </body>
</html> </html>

View File

@ -89,7 +89,7 @@ export const Login: React.FC = () => {
<input placeholder={"请输入账号"}/> <input placeholder={"请输入账号"}/>
</div> </div>
<div className={classes.input}> <div className={classes.input}>
<input placeholder={"请输入密码"}/> <input placeholder={"请输入密码"} type={"password"} />
</div> </div>
<div className={classes.button}> <div className={classes.button}>
<button></button> <button></button>

View File

@ -109,8 +109,12 @@ func (m *meta) Start(ctx context.Context) {
for code, info := range m.m { for code, info := range m.m {
if now.Sub(info.last) > 1*time.Minute { if now.Sub(info.last) > 1*time.Minute {
m.Lock() m.Lock()
info.f.Close() if err := info.f.Close(); err != nil {
os.RemoveAll(opt.FilePath(code)) log.Warn("handler.Meta: [timer] close file failed, file = %s, err = %s", opt.FilePath(code), err.Error())
}
if err := os.RemoveAll(opt.FilePath(code)); err != nil {
log.Warn("handler.Meta: [timer] remove file failed, file = %s, err = %s", opt.FilePath(code), err.Error())
}
delete(m.m, code) delete(m.m, code)
m.Unlock() m.Unlock()
log.Warn("MetaController: code timeout removed, code = %s", code) log.Warn("MetaController: code timeout removed, code = %s", code)

View File

@ -1,93 +1,92 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-CN"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>登录页面</title> <title>Login Page</title>
<style> <style>
* { * {
margin: 0; margin: 0;
padding: 0; padding: 0;
box-sizing: border-box; box-sizing: border-box;
font-family: 'Segoe UI', Arial, sans-serif; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
} }
body { body {
background-color: #f5f5f5;
height: 100vh;
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
min-height: 100vh;
background: #f0f2f5;
} }
.login-container { .login-container {
width: 100%;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
}
.login-box {
background: white; background: white;
padding: 40px; padding: 40px;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
width: 100%; width: 100%;
max-width: 400px; max-width: 400px;
} }
.login-header { h2 {
text-align: center; text-align: center;
color: #333;
margin-bottom: 30px; margin-bottom: 30px;
} }
.login-header h1 {
color: #1a73e8;
font-size: 28px;
margin-bottom: 10px;
}
.login-header p {
color: #666;
font-size: 14px;
}
.form-group { .form-group {
margin-bottom: 20px; margin-bottom: 20px;
} }
.form-group input { label {
display: block;
margin-bottom: 8px;
color: #555;
}
input[type="text"],
input[type="password"] {
width: 100%; width: 100%;
padding: 12px 15px; padding: 12px;
border: 1px solid #ddd; border: 1px solid #ddd;
border-radius: 6px; border-radius: 5px;
font-size: 16px; font-size: 16px;
transition: border-color 0.3s; transition: border-color 0.3s ease;
} }
.form-group input:focus { input[type="text"]:focus,
input[type="password"]:focus {
border-color: #4CAF50;
outline: none; outline: none;
border-color: #1a73e8;
box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
} }
.form-group input:hover { .form-options {
border-color: #1a73e8;
}
.options {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
margin-bottom: 25px; margin-bottom: 20px;
font-size: 14px;
} }
.remember-me { .remember-me {
display: flex; display: flex;
align-items: center; align-items: center;
} gap: 5px;
color: #666;
.remember-me input {
margin-right: 8px;
} }
.forgot-password { .forgot-password {
color: #1a73e8; color: #4CAF50;
text-decoration: none; text-decoration: none;
font-size: 14px;
} }
.forgot-password:hover { .forgot-password:hover {
@ -97,17 +96,17 @@
.login-button { .login-button {
width: 100%; width: 100%;
padding: 12px; padding: 12px;
background: #1a73e8; background-color: #4CAF50;
color: white; color: white;
border: none; border: none;
border-radius: 6px; border-radius: 5px;
font-size: 16px; font-size: 16px;
cursor: pointer; cursor: pointer;
transition: background 0.3s; transition: background-color 0.3s ease;
} }
.login-button:hover { .login-button:hover {
background: #1557b0; background-color: #45a049;
} }
.signup-link { .signup-link {
@ -117,44 +116,50 @@
} }
.signup-link a { .signup-link a {
color: #1a73e8; color: #4CAF50;
text-decoration: none; text-decoration: none;
margin-left: 5px;
} }
.signup-link a:hover { .signup-link a:hover {
text-decoration: underline; text-decoration: underline;
} }
/* Responsive Design */
@media (max-width: 480px) {
.login-box {
padding: 20px;
}
.form-options {
flex-direction: column;
gap: 10px;
align-items: flex-start;
}
}
</style> </style>
</head> </head>
<body> <body>
<div class="login-container"> <div class="login-container">
<div class="login-header"> <div class="login-box">
<h1>欢迎登录</h1> <h2>Welcome Back</h2>
<p>请输入您的账号信息</p> <form class="login-form">
</div>
<form>
<div class="form-group"> <div class="form-group">
<input type="text" placeholder="用户名/邮箱" required> <label for="username">Username</label>
<input type="text" id="username" name="username" required>
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="password" placeholder="密码" required> <label for="password">Password</label>
<input type="password" id="password" name="password" required>
</div> </div>
<div class="form-options">
<div class="options">
<label class="remember-me"> <label class="remember-me">
<input type="checkbox"> 记住我 <input type="checkbox"> Remember me
</label> </label>
<a href="#" class="forgot-password">忘记密码?</a> <a href="#" class="forgot-password">Forgot Password?</a>
</div> </div>
<button type="submit" class="login-button">Log In</button>
<button type="submit" class="login-button">立即登录</button>
</form> </form>
<p class="signup-link">Don't have an account? <a href="#">Sign up</a></p>
<div class="signup-link">
还没有账号?<a href="#">立即注册</a>
</div> </div>
</div> </div>
</body> </body>