Skip to content

Commit

Permalink
windows login
Browse files Browse the repository at this point in the history
  • Loading branch information
xioxin committed Oct 17, 2022
1 parent c200e44 commit f068004
Show file tree
Hide file tree
Showing 11 changed files with 488 additions and 267 deletions.
12 changes: 0 additions & 12 deletions lib/common/global.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class Global {
static late PersistCookieJar cookieJar;

static String? userAgent;
static String? imageCookie;

static Future<void> setUserAgent(String ua) {
userAgent = ua;
Expand All @@ -53,11 +52,6 @@ class Global {
static Future<void> setCookies(String url, List<Cookie> cookies) async {
await Global.cookieJar
.saveFromResponse(Uri.parse(NHConst.baseUrl), cookies);
final savedCookies =
await cookieJar.loadForRequest(Uri.parse(NHConst.baseUrl));
imageCookie = savedCookies
.map((cookie) => '${cookie.name}=${cookie.value}')
.join('; ');
}

static late PackageInfo packageInfo;
Expand Down Expand Up @@ -99,11 +93,5 @@ class Global {
userAgent = hiveHelper.getUserAgent();
userAgent ??= NHConst.userAgent;
globalDioConfig = nhDioConfig.copyWith(userAgent: userAgent);

final savedCookies =
await cookieJar.loadForRequest(Uri.parse(NHConst.baseUrl));
imageCookie = savedCookies
.map((cookie) => '${cookie.name}=${cookie.value}')
.join('; ');
}
}
Loading

0 comments on commit f068004

Please sign in to comment.