From 7c8e509c95c2af0c0d076b13fbbc5aa63a06cb69 Mon Sep 17 00:00:00 2001
From: 905086 <k2049@qq.com>
Date: Sat, 07 Nov 2026 19:35:38 +0800
Subject: [PATCH] chore: 删除无用的测试工具及相关文件

---
 fluttergamebox/lib/pages/login_page.dart |   78 +--------------------------------------
 1 files changed, 2 insertions(+), 76 deletions(-)

diff --git a/fluttergamebox/lib/pages/login_page.dart b/fluttergamebox/lib/pages/login_page.dart
index 29a43b9..f39154d 100644
--- a/fluttergamebox/lib/pages/login_page.dart
+++ b/fluttergamebox/lib/pages/login_page.dart
@@ -1,13 +1,10 @@
-import 'dart:convert';
-
-import 'package:flutter/material.dart';
+import 'package:flutter/material.dart';
 import 'package:fluttergamebox/api/api_client.dart';
 import 'package:fluttergamebox/api/api_service.dart';
 import 'package:fluttergamebox/common/theme.dart';
 import 'package:fluttergamebox/store/app_state.dart';
 import 'package:fluttergamebox/widgets/auth_dialogs.dart';
 import 'package:fluttergamebox/widgets/window_controls.dart';
-import 'package:shared_preferences/shared_preferences.dart';
 
 class LoginPage extends StatefulWidget {
   const LoginPage({super.key});
@@ -43,13 +40,7 @@
       if (res['code'] == 0) {
         await ApiClient.saveToken(res['data']['token']);
         await AppState.instance.refreshUserInfo();
-        if (mounted) {
-          // 登录成功后弹出公告
-          final ann = await ApiService.announcements();
-          if (mounted && ann.isNotEmpty) {
-            showAnnouncementDialog(context, ann);
-          }
-        }
+        // 公告改为进入首页时统一弹出(见 main_shell)
       } else {
         setState(() => _error = res['msg'] ?? '登录失败');
       }
@@ -364,68 +355,3 @@
   Future.delayed(const Duration(seconds: 2), () => entry.remove());
 }
 
-/// 登录成功后的公告弹窗
-void showAnnouncementDialog(BuildContext context, String content) {
-  showDialog(
-    context: context,
-    builder: (context) => Dialog(
-      backgroundColor: Colors.white,
-      shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
-      child: Container(
-        width: 420,
-        padding: const EdgeInsets.all(24),
-        child: Column(
-          mainAxisSize: MainAxisSize.min,
-          crossAxisAlignment: CrossAxisAlignment.start,
-          children: [
-            Row(
-              children: [
-                const Icon(Icons.campaign,
-                    color: Color(0xFF2B7FFF), size: 22),
-                const SizedBox(width: 8),
-                const Text('系统公告',
-                    style: TextStyle(
-                        color: Colors.black,
-                        fontSize: 16,
-                        fontWeight: FontWeight.bold)),
-                const Spacer(),
-                GestureDetector(
-                  onTap: () => Navigator.pop(context),
-                  child: const Icon(Icons.close,
-                      color: Colors.grey, size: 20),
-                ),
-              ],
-            ),
-            const SizedBox(height: 16),
-            ConstrainedBox(
-              constraints: const BoxConstraints(maxHeight: 320),
-              child: SingleChildScrollView(
-                child: Text(
-                  content,
-                  style: const TextStyle(
-                      color: Color(0xFFE74C3C),
-                      fontSize: 13,
-                      height: 1.9),
-                ),
-              ),
-            ),
-            const SizedBox(height: 16),
-            Align(
-              alignment: Alignment.centerRight,
-              child: ElevatedButton(
-                onPressed: () => Navigator.pop(context),
-                style: ElevatedButton.styleFrom(
-                  backgroundColor: const Color(0xFF2B7FFF),
-                  foregroundColor: Colors.white,
-                  shape: RoundedRectangleBorder(
-                      borderRadius: BorderRadius.circular(4)),
-                ),
-                child: const Text('知道了'),
-              ),
-            ),
-          ],
-        ),
-      ),
-    ),
-  );
-}

--
Gitblit v1.10.0