fix: webDav服务器的config和webDavConfig定义不同

This commit is contained in:
Xwite 2023-03-06 17:15:31 +08:00 committed by Xwite
parent bfd94969e3
commit 73d2f25ce5
3 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ data class Server(
}
fun getWebDavConfig(): WebDavConfig? {
return GSON.fromJsonObject<WebDavConfig>(config).getOrNull()
return if (type == TYPE.WEBDAV) GSON.fromJsonObject<WebDavConfig>(config).getOrNull() else null
}
@Parcelize

View File

@ -26,7 +26,7 @@ data class Authorization(
serverID ?: throw NoStackTraceException("Unexpected server ID")
appDb.serverDao.get(serverID)?.getWebDavConfig().run {
data = Credentials.basic(username, password, charset)
}
} ?: throw WebDavException("Unexpected WebDav Authorization")
}
}

View File

@ -27,7 +27,7 @@ class ServerConfigDialog : BaseDialogFragment(R.layout.dialog_webdav_server, tru
private val serverUi = listOf(
RowUi("url"),
RowUi("user"),
RowUi("username"),
RowUi("password", RowUi.Type.password)
)