mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-16 15:16:15 +08:00
merge mine & media
Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -10,7 +10,6 @@ import 'package:PiliPlus/models/user/stat.dart';
|
||||
import 'package:PiliPlus/pages/dynamics/controller.dart';
|
||||
import 'package:PiliPlus/pages/dynamics_tab/controller.dart';
|
||||
import 'package:PiliPlus/pages/live/controller.dart';
|
||||
import 'package:PiliPlus/pages/media/controller.dart';
|
||||
import 'package:PiliPlus/pages/mine/controller.dart';
|
||||
import 'package:PiliPlus/pages/pgc/controller.dart';
|
||||
import 'package:PiliPlus/services/account_service.dart';
|
||||
@@ -47,8 +46,8 @@ class LoginUtils {
|
||||
SmartDialog.showToast('设置登录态失败,$e');
|
||||
}
|
||||
final result = await UserHttp.userInfo();
|
||||
if (result['status']) {
|
||||
final UserInfoData data = result['data'];
|
||||
if (result.isSuccess) {
|
||||
final UserInfoData data = result.data;
|
||||
if (data.isLogin == true) {
|
||||
Get.find<AccountService>()
|
||||
..mid = data.mid!
|
||||
@@ -60,7 +59,7 @@ class LoginUtils {
|
||||
await GStorage.userInfo.put('userInfoCache', data);
|
||||
|
||||
try {
|
||||
Get.find<MineController>().queryUserInfo();
|
||||
Get.find<MineController>().onRefresh();
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
@@ -73,10 +72,6 @@ class LoginUtils {
|
||||
} catch (_) {}
|
||||
}
|
||||
|
||||
try {
|
||||
Get.find<MediaController>().onRefresh();
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
Get.find<LiveController>().onRefresh();
|
||||
} catch (_) {}
|
||||
@@ -97,7 +92,7 @@ class LoginUtils {
|
||||
// 获取用户信息失败
|
||||
await Accounts.deleteAll({account});
|
||||
SmartDialog.showNotify(
|
||||
msg: '登录失败,请检查cookie是否正确,${result['msg']}',
|
||||
msg: '登录失败,请检查cookie是否正确,${result.toString()}',
|
||||
notifyType: NotifyType.warning,
|
||||
);
|
||||
}
|
||||
@@ -120,7 +115,8 @@ class LoginUtils {
|
||||
try {
|
||||
Get.find<MineController>()
|
||||
..userInfo.value = UserInfoData()
|
||||
..userStat.value = UserStat();
|
||||
..userStat.value = UserStat()
|
||||
..loadingState.value = LoadingState.loading();
|
||||
// MineController.anonymity.value = false;
|
||||
} catch (_) {}
|
||||
|
||||
@@ -128,10 +124,6 @@ class LoginUtils {
|
||||
Get.find<DynamicsController>().onRefresh();
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
Get.find<MediaController>().loadingState.value = LoadingState.loading();
|
||||
} catch (_) {}
|
||||
|
||||
try {
|
||||
Get.find<LiveController>().onRefresh();
|
||||
} catch (_) {}
|
||||
|
||||
@@ -708,8 +708,8 @@ class PageUtils {
|
||||
SmartDialog.showLoading(msg: '资源获取中');
|
||||
var result = await SearchHttp.pgcInfo(seasonId: seasonId, epId: epId);
|
||||
SmartDialog.dismiss();
|
||||
if (result['status']) {
|
||||
PgcInfoModel data = result['data'];
|
||||
if (result.isSuccess) {
|
||||
PgcInfoModel data = result.data;
|
||||
|
||||
// epId episode -> progress episode -> first episode
|
||||
EpisodeItem? episode;
|
||||
@@ -771,7 +771,7 @@ class PageUtils {
|
||||
preventDuplicates: false,
|
||||
);
|
||||
} else {
|
||||
SmartDialog.showToast(result['msg']);
|
||||
result.toast();
|
||||
}
|
||||
} catch (e) {
|
||||
SmartDialog.dismiss();
|
||||
|
||||
Reference in New Issue
Block a user