Test example: - https://postman-echo.com/basic-auth - https://httpbin.org/basic-auth/user/passwd - httpbin.org 提供基本的 HTTP 认证测试 - 用户名: user, 密码: passwd
| 359 | // - httpbin.org 提供基本的 HTTP 认证测试 |
| 360 | // - 用户名: user, 密码: passwd |
| 361 | void CFrmWebView::slotAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *auth) |
| 362 | { |
| 363 | qDebug(log) << Q_FUNC_INFO; |
| 364 | CParameterUser user(nullptr); |
| 365 | CDlgUserPassword dlg(this); |
| 366 | dlg.SetUser(tr("Set user and password") + "\n" + requestUrl.toString(), &user); |
| 367 | if (dlg.exec() == QDialog::Accepted) { |
| 368 | auth->setUser(user.GetName()); |
| 369 | auth->setPassword(user.GetPassword()); |
| 370 | } else { |
| 371 | // Set authenticator null if dialog is cancelled |
| 372 | *auth = QAuthenticator(); |
| 373 | } |
| 374 | } |
| 375 | |
| 376 | void CFrmWebView::slotProxyAuthenticationRequired(const QUrl &url, QAuthenticator *auth, |
| 377 | const QString &proxyHost) |
nothing calls this directly
no test coverage detected