login.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>登录 - 展厅控制</title>
  7. <style>
  8. :root {
  9. --primary-color: #4ecdc4;
  10. --secondary-color: #ff6b6b;
  11. --accent-color: #feca57;
  12. --dark-text: #333;
  13. --light-text: #fff;
  14. --bg-gradient: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  15. --card-bg: #ffffff;
  16. }
  17. * {
  18. margin: 0;
  19. padding: 0;
  20. box-sizing: border-box;
  21. }
  22. body {
  23. font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  24. background: var(--bg-gradient);
  25. min-height: 100vh;
  26. display: flex;
  27. align-items: center;
  28. justify-content: center;
  29. color: var(--dark-text);
  30. }
  31. .login-container {
  32. background: var(--card-bg);
  33. border-radius: 15px;
  34. padding: 40px;
  35. width: 100%;
  36. max-width: 400px;
  37. box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  38. animation: fadeIn 0.5s ease-out;
  39. }
  40. @keyframes fadeIn {
  41. from { opacity: 0; transform: translateY(-20px); }
  42. to { opacity: 1; transform: translateY(0); }
  43. }
  44. .header {
  45. text-align: center;
  46. margin-bottom: 30px;
  47. }
  48. .header h1 {
  49. color: #2c3e50;
  50. font-size: 24px;
  51. margin-bottom: 10px;
  52. }
  53. .header p {
  54. color: #7f8c8d;
  55. font-size: 14px;
  56. }
  57. .form-group {
  58. margin-bottom: 20px;
  59. }
  60. label {
  61. display: block;
  62. margin-bottom: 8px;
  63. color: #555;
  64. font-weight: 600;
  65. font-size: 14px;
  66. }
  67. input {
  68. width: 100%;
  69. padding: 12px;
  70. border: 1px solid #ddd;
  71. border-radius: 8px;
  72. font-size: 15px;
  73. transition: border-color 0.3s;
  74. }
  75. input:focus {
  76. border-color: var(--primary-color);
  77. outline: none;
  78. }
  79. .btn-submit {
  80. width: 100%;
  81. padding: 12px;
  82. background-color: var(--primary-color);
  83. color: white;
  84. border: none;
  85. border-radius: 8px;
  86. font-size: 16px;
  87. font-weight: 600;
  88. cursor: pointer;
  89. transition: background-color 0.3s, transform 0.1s;
  90. }
  91. .btn-submit:hover {
  92. background-color: #3dbdb4;
  93. }
  94. .btn-submit:active {
  95. transform: translateY(1px);
  96. }
  97. .alert {
  98. padding: 12px;
  99. border-radius: 8px;
  100. margin-bottom: 20px;
  101. font-size: 14px;
  102. text-align: center;
  103. }
  104. .alert-error {
  105. background-color: #ffebee;
  106. color: #c62828;
  107. border: 1px solid #ffcdd2;
  108. }
  109. .sso-divider {
  110. margin: 20px 0;
  111. text-align: center;
  112. color: #95a5a6;
  113. font-size: 14px;
  114. }
  115. .btn-sso {
  116. display: block;
  117. width: 100%;
  118. padding: 12px;
  119. margin-top: 10px;
  120. background-color: #3498db;
  121. color: white;
  122. text-align: center;
  123. text-decoration: none;
  124. border-radius: 8px;
  125. font-size: 16px;
  126. font-weight: 600;
  127. transition: background-color 0.3s;
  128. }
  129. .btn-sso:hover {
  130. background-color: #2980b9;
  131. }
  132. </style>
  133. </head>
  134. <body>
  135. <div class="login-container">
  136. <div class="header">
  137. <h1>展厅控制系统</h1>
  138. <p>请登录以继续</p>
  139. </div>
  140. {% with messages = get_flashed_messages(with_categories=true) %}
  141. {% if messages %}
  142. {% for category, message in messages %}
  143. <div class="alert alert-{{ category }}">
  144. {{ message }}
  145. </div>
  146. {% endfor %}
  147. {% endif %}
  148. {% endwith %}
  149. <form method="POST" action="/login">
  150. <div class="form-group">
  151. <label for="username">账号</label>
  152. <input type="text" id="username" name="username" placeholder="请输入账号" required autofocus>
  153. </div>
  154. <div class="form-group">
  155. <label for="password">密码</label>
  156. <input type="password" id="password" name="password" placeholder="请输入密码" required>
  157. </div>
  158. <button type="submit" class="btn-submit">登录</button>
  159. <div class="sso-divider">
  160. <span>或</span>
  161. </div>
  162. <a href="/login/sso" class="btn-sso">统一登录</a>
  163. </form>
  164. </div>
  165. </body>
  166. </html>