编码bookurl

pull/1671/head
Xwite 3 years ago
parent f5a05a2973
commit cd03d6fd1e
  1. 6
      app/src/main/java/io/legado/app/api/controller/BookController.kt

@ -72,7 +72,7 @@ object BookController {
val returnData = ReturnData() val returnData = ReturnData()
val bookUrl = parameters["url"]?.firstOrNull() val bookUrl = parameters["url"]?.firstOrNull()
?: return returnData.setErrorMsg("bookUrl为空") ?: return returnData.setErrorMsg("bookUrl为空")
val book = appDb.bookDao.getBook(bookUrl) val book = appDb.bookDao.getBook(URLDecoder.decode(bookUrl, "UTF-8"))
?: return returnData.setErrorMsg("bookUrl不对") ?: return returnData.setErrorMsg("bookUrl不对")
val src = URLDecoder.decode(parameters["path"]?.firstOrNull(), "UTF-8") val src = URLDecoder.decode(parameters["path"]?.firstOrNull(), "UTF-8")
val vFile = BookHelp.getImage(book, src) val vFile = BookHelp.getImage(book, src)
@ -82,7 +82,9 @@ object BookController {
BookHelp.saveImage(bookSource, book, src) BookHelp.saveImage(bookSource, book, src)
} }
} }
return returnData.setData(vFile.readBytes()) return returnData.setData(
BitmapUtils.decodeBitmap(vFile.absolutePath)
)
} }
/** /**

Loading…
Cancel
Save