Skip to content

Commit

Permalink
增加一个有网络优化的接口,增强稳定性
Browse files Browse the repository at this point in the history
  • Loading branch information
czf0613 committed Jan 30, 2023
1 parent b7ab6b3 commit 371b01d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion KCosSDK/src/main/java/ltd/kevinc/kcos/KCosClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import java.util.concurrent.TimeUnit
object KCosClient {
internal val jsonContentType = "application/json;charset=utf-8".toMediaType()
internal val binaryContentType = "application/octet-stream".toMediaType()
internal const val urlBase = "https://cos.kevinc.ltd"
internal const val urlBase = "https://tcp-cos.kevinc.ltd:8080"
internal const val downloadUrlBase = "https://cos.kevinc.ltd"
internal val httpClient by lazy {
OkHttpClient.Builder()
.proxy(Proxy.NO_PROXY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import kotlin.math.min
@Suppress("BlockingMethodInNonBlockingContext")
object KCosFileDownloader {
private fun makeUrl(fileId: Long, password: String? = null): String =
"${KCosClient.urlBase}/file/download?fileId=$fileId" + (if (password == null) "" else "&password=$password")
"${KCosClient.downloadUrlBase}/file/download?fileId=$fileId" + (if (password == null) "" else "&password=$password")

/**
* 获取下载文件的元信息,例如MimeType、文件大小、文件名等等
Expand Down

0 comments on commit 371b01d

Please sign in to comment.