Merge remote-tracking branch 'origin/master'

This commit is contained in:
dorian 2020-01-25 11:15:44 +01:00
commit 35e4fdbca9

View file

@ -64,10 +64,17 @@ ServerConn::ServerConn(QObject *parent) : QObject(parent)
int ServerConn::login(QString username, QString password, bool permanent)
{
// send the request
QVariantMap ret = this->senddata(QUrl("https://www.fanny-leicht.de/j34/index.php/component/fannysubstitutionplan?task=api_login&username=" + username + "&password=" + password));
// prepare URL
qDebug() << ret;
QByteArray usernameByteArray = username.toUtf8();
QByteArray passwordByteArray = password.toUtf8();
QString url =
"https://www.fanny-leicht.de/j34/index.php/component/fannysubstitutionplan?task=api_login&username=" +
usernameByteArray.toBase64() + "&password=" + passwordByteArray.toBase64() + "&loginIsBase64=true";
qDebug() << url;
// send the request
QVariantMap ret = this->senddata(QUrl(url));
if(ret["status"].toInt() == 200){
QJsonDocument jsonDoc = QJsonDocument::fromJson(ret["text"].toString().toUtf8());