fix(login): login2 补 checkCode=用户输入验证码 + codeId(修 checkCodeNotNull)
This commit is contained in:
parent
289b83cd35
commit
ccd3040a67
|
|
@ -41,12 +41,13 @@ LoginLoad* AuthService::loginAsync(const QString& username, const QString& passw
|
||||||
};
|
};
|
||||||
|
|
||||||
// step2:RSA 加密密码(PKCS#1 v1.5 -> base64,可抛 std::exception → ApiChain 转 failed)-> login2。
|
// step2:RSA 加密密码(PKCS#1 v1.5 -> base64,可抛 std::exception → ApiChain 转 failed)-> login2。
|
||||||
ApiChain::StepFactory step2 = [this, username, password](const QList<ApiResponse>&) -> IApiCall* {
|
ApiChain::StepFactory step2 = [this, username, password, code, codeId](const QList<ApiResponse>&) -> IApiCall* {
|
||||||
RsaEncryptor enc(rsaPublicKeyPem_);
|
RsaEncryptor enc(rsaPublicKeyPem_);
|
||||||
const std::string encrypted = enc.encryptBase64(password.toStdString());
|
const std::string encrypted = enc.encryptBase64(password.toStdString());
|
||||||
const QJsonObject body{{QStringLiteral("username"), username},
|
const QJsonObject body{{QStringLiteral("username"), username},
|
||||||
{QStringLiteral("password"), QString::fromStdString(encrypted)},
|
{QStringLiteral("password"), QString::fromStdString(encrypted)},
|
||||||
{QStringLiteral("checkCode"), QString()}};
|
{QStringLiteral("checkCode"), code}, // 用户输入的验证码(后端 checkCodeNotNull)
|
||||||
|
{QStringLiteral("codeId"), codeId}};
|
||||||
return api_.postJsonAsync(QString::fromLatin1(kPathLogin), body);
|
return api_.postJsonAsync(QString::fromLatin1(kPathLogin), body);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue