Compare commits

...

4 Commits

Author SHA1 Message Date
dom
c44e92dcc8 update patch
Signed-off-by: dom <githubaccount56556@proton.me>
2026-06-06 09:41:52 +08:00
dom
14d1c37df5 flutter 3.44.1
Signed-off-by: dom <githubaccount56556@proton.me>
2026-06-06 09:37:11 +08:00
dom
78b3df4019 validate cookie on login
Signed-off-by: dom <githubaccount56556@proton.me>
2026-06-06 08:55:38 +08:00
dom
9acb32aaeb opt logout main
Signed-off-by: dom <githubaccount56556@proton.me>
2026-06-06 08:54:38 +08:00
6 changed files with 23 additions and 13 deletions

2
.fvmrc
View File

@@ -1,3 +1,3 @@
{
"flutter": "3.44.0"
"flutter": "3.44.1"
}

View File

@@ -236,6 +236,20 @@ class LoginPageController extends GetxController
}
}
static String validateCookie(String cookie) {
return cookie
.split(';')
.where((e) {
try {
Cookie.fromSetCookieValue(e.trim());
} catch (_) {
return false;
}
return true;
})
.join(';');
}
// cookie登录
Future<void> loginByCookie() async {
if (cookieTextController.text.isEmpty) {
@@ -247,7 +261,7 @@ class LoginPageController extends GetxController
"/x/member/web/account",
options: Options(
headers: {
"cookie": cookieTextController.text,
"cookie": validateCookie(cookieTextController.text),
},
extra: {'account': AnonymousAccount()},
),

View File

@@ -11,7 +11,6 @@ import 'package:PiliPlus/services/account_service.dart';
import 'package:PiliPlus/utils/accounts.dart';
import 'package:PiliPlus/utils/accounts/account.dart';
import 'package:PiliPlus/utils/extension/scroll_controller_ext.dart';
import 'package:PiliPlus/utils/login_utils.dart';
import 'package:PiliPlus/utils/storage.dart';
import 'package:PiliPlus/utils/storage_key.dart';
import 'package:PiliPlus/utils/storage_pref.dart';
@@ -112,20 +111,22 @@ class MineController extends CommonDataController<FavFolderData, FavFolderData>
..face.value = response.face!
..isLogin.value = true;
} else {
LoginUtils.onLogoutMain();
_onLogoutMain();
return;
}
} else {
final errMsg = res.toString();
SmartDialog.showToast(errMsg);
if (errMsg == '账号未登录') {
LoginUtils.onLogoutMain();
_onLogoutMain();
return;
}
}
queryUserStatOwner();
}
void _onLogoutMain() => Accounts.deleteAll({Accounts.main});
Future<void> queryUserStatOwner() async {
final res = await UserHttp.userStatOwner();
if (res case Success(:final response)) {

View File

@@ -106,12 +106,7 @@ foreach ($patch in $patches) {
# TODO: remove
if ($platform.ToLower() -eq "android") {
git stash
git cherry-pick 625275cfae17b27c9049b0740a9ef67d626b3b1c -X ours
git reset --soft HEAD~1
git stash pop
git restore DEPS
"f84bd039a0692e5cab5383a8de29bc41151a4dfd" | Set-Content -Path .\bin\internal\engine.version
"df67bb3b55323961184ae7117cc91c054f36a42c" | Set-Content -Path .\bin\internal\engine.version
Remove-Item -Path ".\bin\cache" -Recurse -Force
flutter --version
}

View File

@@ -2001,4 +2001,4 @@ packages:
version: "3.1.3"
sdks:
dart: ">=3.12.0 <4.0.0"
flutter: "3.44.0"
flutter: "3.44.1"

View File

@@ -21,7 +21,7 @@ version: 2.0.8+1
environment:
sdk: ">=3.12.0"
flutter: 3.44.0
flutter: 3.44.1
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions