]> acesimba.cloud Git - words.git/commitdiff
feat: 页面底部展示 ICP 备案号(陕ICP备2026022239号-1), 链接工信部备案查询
authorroot <root@localhost.localdomain>
Wed, 19 Aug 2026 02:43:04 +0000 (10:43 +0800)
committerroot <root@localhost.localdomain>
Wed, 19 Aug 2026 02:43:04 +0000 (10:43 +0800)
frontend/src/App.js
frontend/src/components/Footer.css [new file with mode: 0644]
frontend/src/components/Footer.js [new file with mode: 0644]
frontend/src/components/Login.css
frontend/src/index.css

index eac1cdc5da3fd48564c6c602f9416753896df10c..d17f71d61c8d51e393c2b1111f8c5f9b452c15bd 100644 (file)
@@ -7,25 +7,30 @@ import GroupView from './components/GroupView';
 import StudyCalendar from './components/StudyCalendar';
 import SyncNotifications from './components/SyncNotifications';
 import Login from './components/Login';
+import Footer from './components/Footer';
 import { isLoggedIn } from './auth';
 
 function App() {
     const [loggedIn, setLoggedIn] = useState(isLoggedIn());
-    // 未登录:只显示登录页,应用其余部分完全不加载
-    if (!loggedIn) {
-        return <Login onLogin={() => setLoggedIn(true)} />;
-    }
     return (
-        <Router>
-            <SyncNotifications />
-            <Routes>
-                <Route path="/" element={<Home />} />
-                <Route path="/study/:groupId" element={<StudyMode />} />
-                <Route path="/test/:groupId" element={<TestMode />} />
-                <Route path="/group/:groupId" element={<GroupView />} />
-                <Route path="/calendar" element={<StudyCalendar />} />
-            </Routes>
-        </Router>
+        <div className="app-shell">
+            {loggedIn ? (
+                <Router>
+                    <SyncNotifications />
+                    <Routes>
+                        <Route path="/" element={<Home />} />
+                        <Route path="/study/:groupId" element={<StudyMode />} />
+                        <Route path="/test/:groupId" element={<TestMode />} />
+                        <Route path="/group/:groupId" element={<GroupView />} />
+                        <Route path="/calendar" element={<StudyCalendar />} />
+                    </Routes>
+                </Router>
+            ) : (
+                // 未登录:只显示登录页,应用其余部分完全不加载
+                <Login onLogin={() => setLoggedIn(true)} />
+            )}
+            <Footer />
+        </div>
     );
 }
 
diff --git a/frontend/src/components/Footer.css b/frontend/src/components/Footer.css
new file mode 100644 (file)
index 0000000..478346c
--- /dev/null
@@ -0,0 +1,18 @@
+.site-footer {
+    margin-top: auto;
+    padding: 14px 15px;
+    text-align: center;
+    font-size: 12px;
+    color: #8a94a6;
+    border-top: 1px solid #e6ebf2;
+    background: #f7f9fc;
+}
+
+.site-footer a {
+    color: #6b7785;
+    text-decoration: none;
+}
+
+.site-footer a:hover {
+    text-decoration: underline;
+}
diff --git a/frontend/src/components/Footer.js b/frontend/src/components/Footer.js
new file mode 100644 (file)
index 0000000..25f2154
--- /dev/null
@@ -0,0 +1,13 @@
+import React from 'react';
+import './Footer.css';
+
+// 页面底部 ICP 备案号(合规要求:中国大陆网站须公开展示备案号并链接到工信部备案查询)
+export default function Footer() {
+    return (
+        <footer className="site-footer">
+            <a href="https://beian.miit.gov.cn" target="_blank" rel="noopener noreferrer">
+                陕ICP备2026022239号-1
+            </a>
+        </footer>
+    );
+}
index d2156731261283277ed95742c0f696a8712d2615..a7b52cbd35a3cc265257d5ac672d833636fad657 100644 (file)
@@ -1,5 +1,5 @@
 .login-wrap {
-    min-height: 100vh;
+    flex: 1 0 auto;
     display: flex;
     align-items: center;
     justify-content: center;
index ec2585e8c0bb8188184ed1e0703c4c8f2a8419b0..19f30f7e6ad5e62e5ac0ee8ce1ea2660d6439a60 100644 (file)
@@ -11,3 +11,10 @@ code {
   font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
     monospace;
 }
+
+/* 全站外壳:纵向 flex,min-height 撑满视口,使页脚自然贴底 */
+.app-shell {
+  display: flex;
+  flex-direction: column;
+  min-height: 100vh;
+}