Merge pull request #2431 from 821938089/little-fix

一些优化
pull/2437/head
Horis 2 years ago committed by GitHub
commit fec8ae368b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/src/main/assets/defaultData/directLinkUpload.json
  2. 4
      app/src/main/java/io/legado/app/lib/webdav/WebDav.kt

@ -1,5 +1,5 @@
{ {
"uploadUrl": "http://sy.mgz6.cc/shuyuan,{\"method\":\"POST\",\"body\": {\"file\": \"fileRequest\"},\"type\": \"multipart/form-data\"}", "uploadUrl": "https://sy.mgz6.cc/shuyuan,{\"method\":\"POST\",\"body\": {\"file\": \"fileRequest\"},\"type\": \"multipart/form-data\"}",
"downloadUrlRule": "$.data@js:if (result == '') \n '' \n else \n 'https://shuyuan.mgz6.cc/shuyuan/' + result", "downloadUrlRule": "$.data@js:if (result == '') \n '' \n else \n 'https://shuyuan.mgz6.cc/shuyuan/' + result",
"summary": "有效期2天" "summary": "有效期2天"
} }

@ -358,9 +358,9 @@ open class WebDav(val path: String, val authorization: Authorization) {
val exception = document.getElementsByTag("s:exception").firstOrNull()?.text() val exception = document.getElementsByTag("s:exception").firstOrNull()?.text()
val message = document.getElementsByTag("s:message").firstOrNull()?.text() val message = document.getElementsByTag("s:message").firstOrNull()?.text()
if (exception == "ObjectNotFound") { if (exception == "ObjectNotFound") {
throw ObjectNotFoundException(message ?: "$path doesn't exist") throw ObjectNotFoundException(message ?: "$path doesn't exist. code:${response.code}")
} }
throw WebDavException(message ?: "未知错误") throw WebDavException(message ?: "未知错误 code:${response.code}")
} }
} }

Loading…
Cancel
Save