fix(login): 每次登录自动清除 WebView 登录态

登录前自动清 Cookie/WebStorage,避免上一个号码的登录态串到新账号。账号凭据本身已按账号 ID 独立保存。
This commit is contained in:
Liuxinyu176 2026-10-09 15:35:19 +08:00
parent 3c2b2ec16e
commit 46b4d457b8
2 changed files with 7 additions and 2 deletions

View File

@ -16,8 +16,8 @@ android {
applicationId = "com.rainy.token"
minSdk = 31
targetSdk = 35
versionCode = 29
versionName = "1.7.9"
versionCode = 30
versionName = "1.7.10"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {

View File

@ -82,6 +82,11 @@ class WebViewLoginViewModel @Inject constructor(
)
}
// 每次进入登录页强制清掉 WebView 全局登录态,避免沿用上一个账号的 Cookie
if (service == ServiceType.TRAE || service == ServiceType.WORKBUDDY) {
clearWebViewSession()
}
when (service) {
ServiceType.TRAE -> bindTrae()
ServiceType.WORKBUDDY -> bindWorkBuddy()