|
|
|
@ -95,11 +95,17 @@ interface BaseSource : JsExtensions { |
|
|
|
|
* 保存登录头部信息,map格式,访问时自动添加 |
|
|
|
|
*/ |
|
|
|
|
fun putLoginHeader(header: String) { |
|
|
|
|
val headerMap = GSON.fromJsonObject<Map<String, String>>(header).getOrNull() |
|
|
|
|
val cookie = headerMap?.get("Cookie") ?: headerMap?.get("cookie") |
|
|
|
|
cookie?.let { |
|
|
|
|
CookieStore.replaceCookie(getKey(), it) |
|
|
|
|
} |
|
|
|
|
CacheManager.put("loginHeader_${getKey()}", header) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun removeLoginHeader() { |
|
|
|
|
CacheManager.delete("loginHeader_${getKey()}") |
|
|
|
|
CookieStore.removeCookie(getKey()) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|