[skip ci] fix typo

This commit is contained in:
Xwite 2023-03-25 14:48:43 +08:00 committed by GitHub
parent 38307689a9
commit bed7a5a6a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -197,17 +197,17 @@ interface JsExtensions : JsEncodeUtils {
*/
fun cacheFile(urlStr: String, saveTime: Int): String {
val key = md5Encode16(urlStr)
val cahcePath = CacheManager.get(key)
val cachePath = CacheManager.get(key)
return if (
cahcePath.isNullOrBlank() ||
!getFile(cahcePath).exists()
cachePath.isNullOrBlank() ||
!getFile(cachePath).exists()
) {
val path = downloadFile(urlStr)
log("首次下载 $urlStr >> $path")
CacheManager.put(key, path, saveTime)
readTxtFile(path)
} else {
readTxtFile(cahcePath)
readTxtFile(cachePath)
}
}