Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
laki_icu_app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张宏
laki_icu_app
Commits
81dfa010
Commit
81dfa010
authored
Jun 22, 2026
by
张宏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录调整
parent
4ffa57f5
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
7 deletions
+46
-7
main.dart
lib/main.dart
+43
-1
app_router.dart
lib/routes/app_router.dart
+2
-1
monitoring_index_view.dart
lib/views/monitoring/index/monitoring_index_view.dart
+1
-5
monitoring_metric_card.dart
...iews/monitoring/index/widgets/monitoring_metric_card.dart
+0
-0
No files found.
lib/main.dart
View file @
81dfa010
...
...
@@ -62,6 +62,7 @@ class _MyAppState extends State<MyApp> {
late
final
AppRouter
_appRouter
;
late
final
AuthBloc
_authBloc
;
StreamSubscription
?
_tokenExpiredSubscription
;
bool
_isInitializing
=
true
;
@override
void
initState
()
{
...
...
@@ -102,7 +103,43 @@ class _MyAppState extends State<MyApp> {
// Token 有效,尝试恢复用户信息
_authBloc
.
add
(
const
AuthFetchUserInfo
());
}
_endInitializing
();
}
else
{
// 无 Token,执行静默登录
await
_performSilentLogin
();
}
}
/// 静默登录:使用预设账号自动登录
Future
<
void
>
_performSilentLogin
()
async
{
try
{
await
_authService
.
login
(
'13800000001'
,
'111111'
);
// 登录成功,获取用户信息
_authBloc
.
add
(
const
AuthFetchUserInfo
());
}
catch
(
e
)
{
// 静默登录失败,不做任何处理,初始化结束
}
finally
{
_endInitializing
();
}
}
void
_endInitializing
()
{
if
(
mounted
)
{
setState
(()
{
_isInitializing
=
false
;
});
}
}
Widget
_buildSplash
()
{
return
Positioned
.
fill
(
child:
ColoredBox
(
color:
const
Color
(
0xFFF5F7FA
),
child:
Center
(
child:
CircularProgressIndicator
(),
),
),
);
}
@override
...
...
@@ -143,11 +180,16 @@ class _MyAppState extends State<MyApp> {
// BlocListener<UserBloc, UserState>(listener: ...),
// BlocListener<SettingsBloc, SettingsState>(listener: ...),
],
child:
MaterialApp
.
router
(
child:
Stack
(
children:
[
MaterialApp
.
router
(
scaffoldMessengerKey:
_scaffoldMessengerKey
,
routerConfig:
_appRouter
.
config
(),
debugShowCheckedModeBanner:
false
,
),
if
(
_isInitializing
)
_buildSplash
(),
],
),
),
);
},
...
...
lib/routes/app_router.dart
View file @
81dfa010
...
...
@@ -16,10 +16,11 @@ class AppRouter extends $AppRouter {
@override
List
<
AutoRoute
>
get
routes
=>
[
// LoginRoute / LoginView(登录页)
AutoRoute
(
page:
LoginRoute
.
page
,
initial:
true
),
AutoRoute
(
page:
LoginRoute
.
page
),
// DefaultLayoutRoute / DefaultLayoutView(默认布局页/主框架)
AutoRoute
(
page:
DefaultLayoutRoute
.
page
,
initial:
true
,
children:
[
// MonitoringIndexRoute / MonitoringIndexView(监控页)
AutoRoute
(
page:
MonitoringIndexRoute
.
page
,
initial:
true
),
...
...
lib/views/monitoring/index/monitoring_index_view.dart
View file @
81dfa010
...
...
@@ -188,13 +188,9 @@ class _MonitoringIndexContentState extends State<MonitoringIndexContent> {
.
map
(
(
metric
)
=>
Expanded
(
child:
Container
(
padding:
EdgeInsets
.
zero
,
decoration:
BoxDecoration
(
//
border: BoxBorder.all(width: 1.w,color: Colors.red)
border:
BoxBorder
.
all
(
width:
1
.
w
,
color:
Colors
.
red
)
),
// padding: EdgeInsets.only(
// right: metric == displayMetrics.last ? 0 : gap,
// ),
child:
MonitoringMetricCard
(
metric:
metric
),
),
),
...
...
lib/views/monitoring/index/widgets/monitoring_metric_card.dart
View file @
81dfa010
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment