mirror of
https://github.com/venera-app/venera.git
synced 2025-12-16 15:11:14 +00:00
Compare commits
1 Commits
fix/zip-ch
...
feat/login
| Author | SHA1 | Date | |
|---|---|---|---|
| 5ccf0eea43 |
@@ -1245,6 +1245,15 @@ class _LoginPageState extends State<_LoginPage> {
|
|||||||
if (widget.config.checkLoginStatus != null &&
|
if (widget.config.checkLoginStatus != null &&
|
||||||
widget.config.checkLoginStatus!(url, title)) {
|
widget.config.checkLoginStatus!(url, title)) {
|
||||||
var cookies = (await c.getCookies(url)) ?? [];
|
var cookies = (await c.getCookies(url)) ?? [];
|
||||||
|
var localStorageItems = await c.webStorage.localStorage.getItems();
|
||||||
|
var mappedLocalStorage = <String, dynamic>{};
|
||||||
|
for (var item in localStorageItems) {
|
||||||
|
if (item.key != null) {
|
||||||
|
mappedLocalStorage[item.key!] = item.value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
widget.source.data['_localStorage'] = mappedLocalStorage;
|
||||||
|
await widget.source.saveData();
|
||||||
SingleInstanceCookieJar.instance?.saveFromResponse(
|
SingleInstanceCookieJar.instance?.saveFromResponse(
|
||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
cookies,
|
cookies,
|
||||||
@@ -1306,6 +1315,20 @@ class _LoginPageState extends State<_LoginPage> {
|
|||||||
Uri.parse(url),
|
Uri.parse(url),
|
||||||
cookies,
|
cookies,
|
||||||
);
|
);
|
||||||
|
var localStorageJson = await webview.evaluateJavascript(
|
||||||
|
"JSON.stringify(window.localStorage);",
|
||||||
|
);
|
||||||
|
var localStorage = <String, dynamic>{};
|
||||||
|
try {
|
||||||
|
var decoded = jsonDecode(localStorageJson ?? '');
|
||||||
|
if (decoded is Map<String, dynamic>) {
|
||||||
|
localStorage = decoded;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Log.error("ComicSourcePage", "Failed to parse localStorage JSON\n$e");
|
||||||
|
}
|
||||||
|
widget.source.data['_localStorage'] = localStorage;
|
||||||
|
await widget.source.saveData();
|
||||||
success = true;
|
success = true;
|
||||||
widget.config.onLoginWithWebviewSuccess?.call();
|
widget.config.onLoginWithWebviewSuccess?.call();
|
||||||
webview.close();
|
webview.close();
|
||||||
|
|||||||
@@ -1126,10 +1126,10 @@ packages:
|
|||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
name: zip_flutter
|
name: zip_flutter
|
||||||
sha256: baecf8deb6bf53a50e5ab513707ab56cc0c25f5b43333aa56ef562e8e7057357
|
sha256: c4d5a34c5803def866bc550926bb16fe89717c9b7304695d5b2ede30964eb8a8
|
||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.0.13"
|
version: "0.0.12"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.8.0 <4.0.0"
|
dart: ">=3.8.0 <4.0.0"
|
||||||
flutter: ">=3.35.5"
|
flutter: ">=3.35.5"
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ dependencies:
|
|||||||
sliver_tools: ^0.2.12
|
sliver_tools: ^0.2.12
|
||||||
flutter_file_dialog: ^3.0.2
|
flutter_file_dialog: ^3.0.2
|
||||||
file_selector: ^1.0.3
|
file_selector: ^1.0.3
|
||||||
zip_flutter: ^0.0.13
|
zip_flutter: ^0.0.12
|
||||||
lodepng_flutter:
|
lodepng_flutter:
|
||||||
git:
|
git:
|
||||||
url: https://github.com/venera-app/lodepng_flutter
|
url: https://github.com/venera-app/lodepng_flutter
|
||||||
|
|||||||
Reference in New Issue
Block a user