pull/1274/head
gedoor 3 years ago
parent 7e469d144b
commit e66e6dd470
  1. 10
      app/src/main/java/io/legado/app/ui/login/RuleUiLoginDialog.kt

@ -15,6 +15,7 @@ import io.legado.app.ui.widget.text.EditText
import io.legado.app.ui.widget.text.TextInputLayout
import io.legado.app.utils.GSON
import io.legado.app.utils.applyTint
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
class RuleUiLoginDialog : BaseDialogFragment() {
@ -84,9 +85,14 @@ class RuleUiLoginDialog : BaseDialogFragment() {
}
}
bookSource.putLoginInfo(GSON.toJson(loginData))
bookSource.loginUrl?.let {
bookSource.getLoginJs()?.let {
try {
bookSource.evalJS(it)
toastOnUi(R.string.success)
} catch (e: Exception) {
e.printStackTrace()
toastOnUi(e.localizedMessage ?: "ERROR")
}
}
}
}

Loading…
Cancel
Save