mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
mod: account (#591)
* fix: onLoginMain * fix: account override * opt: sponsor block url
This commit is contained in:
committed by
GitHub
parent
64fc995f6b
commit
e190ca5868
@@ -642,14 +642,15 @@ class LoginPageController extends GetxController
|
||||
}
|
||||
|
||||
Future<void> setAccount(Map tokenInfo, List cookieInfo) async {
|
||||
final account = LoginAccount(BiliCookieJar.fromList(cookieInfo),
|
||||
tokenInfo['access_token'], tokenInfo['refresh_token']);
|
||||
await Future.wait([
|
||||
LoginAccount(BiliCookieJar.fromList(cookieInfo),
|
||||
tokenInfo['access_token'], tokenInfo['refresh_token'])
|
||||
.onChange(),
|
||||
account.onChange(),
|
||||
AnonymousAccount()
|
||||
.delete()
|
||||
.then((_) => Request.buvidActive(AnonymousAccount()))
|
||||
]);
|
||||
Accounts.accountMode.updateAll((_, a) => a == account ? account : a);
|
||||
if (Accounts.main.isLogin) {
|
||||
SmartDialog.showToast('登录成功');
|
||||
} else {
|
||||
|
||||
@@ -289,6 +289,7 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
_blockServer = HttpString.sponsorBlockBaseUrl;
|
||||
await setting.put(
|
||||
SettingBoxKey.blockServer, _blockServer);
|
||||
Request.accountManager.blockServer = _blockServer;
|
||||
setState(() {});
|
||||
},
|
||||
child: Text('重置'),
|
||||
@@ -308,6 +309,7 @@ class _SponsorBlockPageState extends State<SponsorBlockPage> {
|
||||
_blockServer = _textController.text;
|
||||
await setting.put(
|
||||
SettingBoxKey.blockServer, _blockServer);
|
||||
Request.accountManager.blockServer = _blockServer;
|
||||
setState(() {});
|
||||
},
|
||||
child: Text('确定'),
|
||||
|
||||
Reference in New Issue
Block a user