mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-08 20:14:51 +08:00
Compare commits
4 Commits
50070997de
...
c44e92dcc8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c44e92dcc8 | ||
|
|
14d1c37df5 | ||
|
|
78b3df4019 | ||
|
|
9acb32aaeb |
@@ -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()},
|
||||
),
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user