Skip to content

Commit a2b590a

Browse files
committed
Fix issues with using webview to assist with cookie login on iOS platform
1 parent de60aa2 commit a2b590a

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

changelog/v8.0.11+307.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- 修复ios平台使用webview辅助cookie登录的问题
2+
3+
--------------------
4+
5+
- Fix issues with using webview to assist with cookie login on iOS platform

lib/src/pages/setting/account/login/login_page_logic.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ class LoginPageLogic extends GetxController {
316316
}
317317

318318
String? guestHint = await webview.evaluateJavaScript('''
319-
document.querySelector('#userlinksguest').innerText
319+
document.querySelector('#userlinksguest').innerText ?? ""
320320
''');
321321

322322
bool loginFailed = !isEmptyOrNull(guestHint) && guestHint != 'null';
@@ -331,7 +331,7 @@ class LoginPageLogic extends GetxController {
331331
}
332332

333333
String? username = await webview.evaluateJavaScript('''
334-
document.querySelector('.home > b > a').innerText
334+
document.querySelector('.home > b > a').innerText ?? ""
335335
''');
336336
if (isEmptyOrNull(username) || username == 'null') {
337337
return;
@@ -371,7 +371,7 @@ class LoginPageLogic extends GetxController {
371371
}
372372

373373
String? guestHint = await controller.runJavaScriptReturningResult('''
374-
document.querySelector('#userlinksguest').innerText
374+
document.querySelector('#userlinksguest').innerText ?? ""
375375
''') as String?;
376376

377377
bool loginFailed = !isEmptyOrNull(guestHint) && guestHint != 'null';
@@ -386,7 +386,7 @@ class LoginPageLogic extends GetxController {
386386
}
387387

388388
String? username = await controller.runJavaScriptReturningResult('''
389-
document.querySelector('.home > b > a').innerText
389+
document.querySelector('.home > b > a').innerText ?? ""
390390
''') as String?;
391391
log.info(username ?? '');
392392
if (isEmptyOrNull(username) || username == 'null') {

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: jhentai
22
description: A flutter app for E-Hentai/EXHentai
33

44
publish_to: 'none'
5-
version: 8.0.11+306
5+
version: 8.0.11+307
66

77
environment:
88
sdk: '>=3.0.0 <4.0.0'

0 commit comments

Comments
 (0)