mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 05:12:17 +00:00
Shamrock
: 兼容性正反向HTTP调整
This commit is contained in:
@ -8,6 +8,7 @@ import android.os.Bundle
|
||||
import androidx.core.content.ContextCompat.startActivity
|
||||
import io.ktor.client.request.get
|
||||
import io.ktor.client.request.header
|
||||
import io.ktor.client.request.parameter
|
||||
import io.ktor.client.request.url
|
||||
import io.ktor.client.statement.bodyAsText
|
||||
import io.ktor.http.HttpStatusCode
|
||||
@ -58,7 +59,7 @@ object DashboardInitializer {
|
||||
url("http://127.0.0.1:$servicePort/get_account_info")
|
||||
val token = ShamrockConfig.getToken(context)
|
||||
if (token.isNotBlank()) {
|
||||
header("Authorization", "Bearer $token")
|
||||
parameter("token", token)
|
||||
}
|
||||
}.let {
|
||||
if (it.status == HttpStatusCode.OK) {
|
||||
|
Reference in New Issue
Block a user