diff --git a/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt b/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt index 84e917a..82f5cdf 100644 --- a/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt +++ b/app/src/main/java/xyz/fycz/myreader/greendao/service/CookieStore.kt @@ -53,6 +53,12 @@ object CookieStore : CookieManager { return cookieBean?.cookie ?: "" } + fun getKey(url: String, key: String): String { + val cookie = getCookie(url) + val cookieMap = cookieToMap(cookie) + return cookieMap[key] ?: "" + } + override fun removeCookie(url: String) { DbManager.getDaoSession().cookieBeanDao.deleteByKey(NetworkUtils.getSubDomain(url)) } @@ -93,4 +99,4 @@ object CookieStore : CookieManager { } return builder.deleteCharAt(builder.lastIndexOf(";")).toString() } -} \ No newline at end of file +}