fix: liveRoom layout error

This commit is contained in:
guozhigq
2024-11-24 22:08:45 +08:00
parent 0b1fff3f03
commit 17a87d2336
2 changed files with 29 additions and 23 deletions

View File

@ -68,7 +68,7 @@ class Request {
// 从cookie中获取 csrf token // 从cookie中获取 csrf token
static Future<String> getCsrf() async { static Future<String> getCsrf() async {
List<Cookie> cookies = await cookieManager.cookieJar List<Cookie> cookies = await cookieManager.cookieJar
.loadForRequest(Uri.parse(HttpString.apiBaseUrl)); .loadForRequest(Uri.parse(HttpString.baseUrl));
String token = ''; String token = '';
if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) { if (cookies.where((e) => e.name == 'bili_jct').isNotEmpty) {
token = cookies.firstWhere((e) => e.name == 'bili_jct').value; token = cookies.firstWhere((e) => e.name == 'bili_jct').value;
@ -82,9 +82,12 @@ class Request {
} }
final List<Cookie> cookies = await cookieManager.cookieJar final List<Cookie> cookies = await cookieManager.cookieJar
.loadForRequest(Uri.parse(HttpString.baseUrl)); .loadForRequest(Uri.parse(HttpString.apiBaseUrl));
buvid = cookies.firstWhere((cookie) => cookie.name == 'buvid3').value; buvid = cookies
if (buvid == null) { .firstWhere((cookie) => cookie.name == 'buvid3',
orElse: () => Cookie('buvid3', ''))
.value;
if (buvid == null || buvid!.isEmpty) {
try { try {
var result = await Request().get( var result = await Request().get(
"${HttpString.apiBaseUrl}/x/frontend/finger/spi", "${HttpString.apiBaseUrl}/x/frontend/finger/spi",

View File

@ -312,7 +312,9 @@ class _LiveRoomPageState extends State<LiveRoomPage>
), ),
), ),
// 消息列表 // 消息列表
Obx( Visibility(
visible: !isLandscape,
child: Obx(
() => Align( () => Align(
alignment: Alignment.bottomCenter, alignment: Alignment.bottomCenter,
child: Container( child: Container(
@ -335,6 +337,7 @@ class _LiveRoomPageState extends State<LiveRoomPage>
), ),
), ),
), ),
),
// 消息输入框 // 消息输入框
Visibility( Visibility(
visible: isPortrait, visible: isPortrait,