From 73cffb704f2ff2597b6b4d6a2ae25370d9182df6 Mon Sep 17 00:00:00 2001 From: repair-agent Date: Mon, 2 Mar 2026 15:57:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=9D=E5=AD=98=E6=95=85=E4=BA=8B?= =?UTF-8?q?=E6=97=B6=E5=B0=86=20cover=5Furl=20=E5=86=99=E5=85=A5=E5=90=8E?= =?UTF-8?q?=E7=AB=AF=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B9=A6=E6=9E=B6=E5=B0=81?= =?UTF-8?q?=E9=9D=A2=E4=B8=BA=E7=A9=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _addNewBookWithAnimation 新增 coverUrl 参数,POST /stories/ 时携带 cover_url 字段,两处调用均从 saveResult 传入生成好的封面 URL。 Co-Authored-By: Claude Sonnet 4.6 --- airhub_app/lib/pages/device_control_page.dart | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airhub_app/lib/pages/device_control_page.dart b/airhub_app/lib/pages/device_control_page.dart index 4a59ac2..ea48e3d 100644 --- a/airhub_app/lib/pages/device_control_page.dart +++ b/airhub_app/lib/pages/device_control_page.dart @@ -474,6 +474,7 @@ class _DeviceControlPageState extends ConsumerState await _addNewBookWithAnimation( title: saveResult['title'] as String? ?? '新故事', content: saveResult['content'] as String? ?? '', + coverUrl: saveResult['cover_url'] as String? ?? '', ); } } @@ -601,6 +602,7 @@ class _DeviceControlPageState extends ConsumerState _addNewBookWithAnimation( title: saveResult['title'] as String? ?? '新故事', content: saveResult['content'] as String? ?? '', + coverUrl: saveResult['cover_url'] as String? ?? '', ); } } @@ -900,7 +902,7 @@ class _DeviceControlPageState extends ConsumerState ); } - Future _addNewBookWithAnimation({String title = '新故事', String content = ''}) async { + Future _addNewBookWithAnimation({String title = '新故事', String content = '', String coverUrl = ''}) async { // Find the first shelf that has space int? targetShelfId; for (final shelf in _shelves) { @@ -923,6 +925,7 @@ class _DeviceControlPageState extends ConsumerState 'title': title, 'content': content, 'shelf_id': targetShelfId, + if (coverUrl.isNotEmpty) 'cover_url': coverUrl, }); // Reload to get the new story await _loadShelves();