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

View File

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