完成登出

This commit is contained in:
2024-09-20 21:40:57 +08:00
parent 054dd68b89
commit fc7d9336cd
18 changed files with 118 additions and 32 deletions

View File

@@ -1,5 +1,6 @@
package com.aiosman.riderpro.data
import com.aiosman.riderpro.AppState
import com.aiosman.riderpro.data.api.ApiClient
import com.aiosman.riderpro.data.api.ChangePasswordRequestBody
import com.aiosman.riderpro.data.api.GoogleRegisterRequestBody
@@ -366,6 +367,7 @@ class AccountServiceImpl : AccountService {
override suspend fun getMyAccount(): UserAuth {
val resp = ApiClient.api.checkToken()
val body = resp.body() ?: throw ServiceException("Failed to get account")
AppState.UserId = body.id
return UserAuth(body.id)
}