mirror of
https://github.com/InvertGeek/MixFile.git
synced 2026-06-01 17:10:49 +08:00
修复线路
This commit is contained in:
@@ -14,8 +14,8 @@ android {
|
||||
applicationId = "com.donut.mixfile"
|
||||
minSdk = 24
|
||||
targetSdk = 34
|
||||
versionCode = 48
|
||||
versionName = "1.5.0"
|
||||
versionCode = 49
|
||||
versionName = "1.5.1"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
vectorDrawables {
|
||||
|
||||
@@ -15,15 +15,11 @@ object A3Uploader : Uploader("线路A3") {
|
||||
get() = ""
|
||||
|
||||
override suspend fun doUpload(fileData: ByteArray): String {
|
||||
val result = uploadClient.submitFormWithBinaryData("https://pic.2xb.cn/uppic.php?type=qq",
|
||||
val result = uploadClient.submitFormWithBinaryData("https://chatbot.weixin.qq.com/weixinh5/webapp/pfnYYEumBeFN7Yb3TAxwrabYVOa4R9/cos/upload",
|
||||
formData {
|
||||
add("file", fileData, fileFormHeaders())
|
||||
add("media", fileData, fileFormHeaders())
|
||||
}) {
|
||||
}.body<JsonObject>()
|
||||
val code = result.get("code").asInt
|
||||
if (code != 200) {
|
||||
throw Exception("上传失败: $code")
|
||||
}
|
||||
|
||||
return result.get("url").asString
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.donut.mixfile
|
||||
|
||||
import com.donut.mixfile.util.file.encodeHex
|
||||
import com.donut.mixfile.util.genRandomString
|
||||
import kotlinx.coroutines.runBlocking
|
||||
import org.junit.Test
|
||||
|
||||
@@ -16,7 +18,9 @@ class ExampleUnitTest {
|
||||
@Test
|
||||
fun main() {
|
||||
runBlocking {
|
||||
println(
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user