优化
This commit is contained in:
@@ -139,7 +139,7 @@ interface JsExtensions {
|
|||||||
path.startsWith("/storage") -> FileUtils.readText(path)
|
path.startsWith("/storage") -> FileUtils.readText(path)
|
||||||
else -> {
|
else -> {
|
||||||
//相对路径
|
//相对路径
|
||||||
val jsPath = if (path.startsWith("/")) path else "/" + path
|
val jsPath = if (path.startsWith("/")) path else "/$path"
|
||||||
//先找书籍保存目录下有没有
|
//先找书籍保存目录下有没有
|
||||||
val publicStoragePath = AppConfig.defaultBookTreeUri
|
val publicStoragePath = AppConfig.defaultBookTreeUri
|
||||||
val jsString = publicStoragePath?.let {
|
val jsString = publicStoragePath?.let {
|
||||||
@@ -154,7 +154,7 @@ interface JsExtensions {
|
|||||||
if (jsString.isNullOrBlank()) readTxtFile(path) else jsString
|
if (jsString.isNullOrBlank()) readTxtFile(path) else jsString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (result.isBlank()) throw NoStackTraceException("${path} 内容获取失败或者为空")
|
if (result.isBlank()) throw NoStackTraceException("$path 内容获取失败或者为空")
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user