Commit ccd0ad5f by huangzhicong

根据js包调整回调接口

parent dea3b668
...@@ -38,14 +38,14 @@ class WebViewProxy( ...@@ -38,14 +38,14 @@ class WebViewProxy(
fun <T> success(method: String, result: Result<T>, data: T? = null) { fun <T> success(method: String, result: Result<T>, data: T? = null) {
val json = gson.toJson(result.apply { success(data) }) val json = gson.toJson(result.apply { success(data) })
webView.evaluateJavascript("javascript:onResult('$method', '$json')", null) webView.evaluateJavascript("javascript:__maxrockyWebViewJavascriptBridgeCallBack__('$method', '$json')", null)
} }
fun <T> failed(method: String, result: Result<T>, msg: String) = failed(method, result, msg, null) fun <T> failed(method: String, result: Result<T>, msg: String) = failed(method, result, msg, null)
fun <T> failed(method: String, result: Result<T>, msg: String, data: T? = null) { fun <T> failed(method: String, result: Result<T>, msg: String, data: T? = null) {
val json = gson.toJson(result.apply { failed(msg, data) }) val json = gson.toJson(result.apply { failed(msg, data) })
webView.evaluateJavascript("javascript:onResult('$method', '$json')", null) webView.evaluateJavascript("javascript:__maxrockyWebViewJavascriptBridgeCallBack__('$method', '$json')", null)
} }
private fun fileToBase64( private fun fileToBase64(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment