Merge branch 'main' into feature-cookies

This commit is contained in:
guozhigq
2024-12-01 21:13:49 +08:00
168 changed files with 2481 additions and 1772 deletions

View File

@ -17,9 +17,6 @@ import 'package:pilipala/utils/storage.dart';
import 'package:uuid/uuid.dart';
class LoginUtils {
static Box userInfoCache = GStrorage.userInfo;
static Box localCache = GStrorage.localCache;
static Future refreshLoginStatus(bool status) async {
try {
// 更改我的页面登录状态
@ -74,7 +71,7 @@ class LoginUtils {
if (result['status'] && result['data'].isLogin) {
SmartDialog.showToast('登录成功');
try {
Box userInfoCache = GStrorage.userInfo;
Box userInfoCache = GStorage.userInfo;
if (!userInfoCache.isOpen) {
userInfoCache = await Hive.openBox('userInfo');
}
@ -119,7 +116,7 @@ class LoginUtils {
Request.dio.options.headers['cookie'] = '';
userInfoCache.put('userInfoCache', null);
localCache.put(LocalCacheKey.accessKey, {'mid': -1, 'value': ''});
GlobalDataCache().userInfo = null;
GlobalDataCache.userInfo = null;
await refreshLoginStatus(false);
}
}