几乎完成
This commit is contained in:
@ -165,7 +165,7 @@ RequestBodyBase::RequestBodyBase(){
|
||||
url_param = "?";
|
||||
url_param += "product=";
|
||||
url_param += product;
|
||||
url_param += "&parter_id=";
|
||||
url_param += "&partner_id=";
|
||||
url_param += parter_id;
|
||||
url_param += "&os=";
|
||||
url_param += this->os;
|
||||
@ -252,14 +252,24 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) {
|
||||
for(auto value:array){
|
||||
QJsonObject object=value.toObject();
|
||||
Button button;
|
||||
button.img=object.value("img").toString();
|
||||
button.orig_name= object.value("orig_name").toString();
|
||||
// button.img_cover=object.value("img_cover").toString();
|
||||
button.title=object.value("name").toString();
|
||||
button.categroy_id = object.value("category_id").toString();
|
||||
button.img = object.value("img").toString();
|
||||
button.png = object.value("logo").toString();
|
||||
button.img_name = object.value("img_name").toString();
|
||||
button.name = object.value("name").toString();
|
||||
button.type = object.value("type").toString();
|
||||
button.sort = object.value("sort").toInt();
|
||||
button.status = object.value("status").toInt();
|
||||
button.is_navbar = object.value("is_navbar").toBool();
|
||||
button.is_elite = object.value("is_elite").toBool();
|
||||
button.orig_name = object.value("orig_name").toString();
|
||||
button.categroy_id = object.value("categroy_id").toString();
|
||||
button.op = object.value("op").toString();
|
||||
button.func=object.value("func").toString();
|
||||
button.url=object.value("url").toString();
|
||||
button.func = object.value("func").toString();
|
||||
button.url = object.value("url").toString();
|
||||
button.dev = object.value("dev").toString();
|
||||
button.locked = object.value("locked").toBool();
|
||||
button.is_delete = object.value("is_delete").toBool();
|
||||
button.version = object.value("version").toString();
|
||||
configResponse->buttons << button;
|
||||
i++;
|
||||
}
|
||||
@ -620,7 +630,7 @@ bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QStrin
|
||||
QJsonObject object;
|
||||
object.insert("reg", array);
|
||||
object.insert("start", menu_list);
|
||||
object.insert("exists", software_exists);
|
||||
object.insert("app", software_exists);
|
||||
obj_root.insert("data", object);
|
||||
obj_root.insert("type", "update");
|
||||
qJsonDocument.setObject(obj_root);
|
||||
@ -643,8 +653,9 @@ bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QStrin
|
||||
// auto error = reply->error();
|
||||
//如果没有错误
|
||||
qDebug() << reply->error();
|
||||
auto result2=reply->readAll();
|
||||
if (reply->error() == QNetworkReply::NoError) {
|
||||
result = QJsonDocument::fromJson(reply->readAll());
|
||||
result = QJsonDocument::fromJson(result2);
|
||||
}
|
||||
else {
|
||||
//如果有错误
|
||||
@ -652,7 +663,7 @@ bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QStrin
|
||||
return false;
|
||||
}
|
||||
//qDebug() << result.toJson();
|
||||
|
||||
records->clear();
|
||||
//如果数据完整
|
||||
if (result.isObject()) {
|
||||
QJsonObject obj_root2 = result.object();
|
||||
@ -689,17 +700,26 @@ bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QStrin
|
||||
file.close();
|
||||
}
|
||||
}
|
||||
|
||||
(*records)[orig_name].logo = dir + orig_name + ".svg";
|
||||
(*records)[orig_name].name = object.value("name").toString();
|
||||
(*records)[orig_name].locked = object.value("locked").toBool();
|
||||
(*records)[orig_name].url = object.value("url").toString();
|
||||
(*records)[orig_name].path = object.value("path").toString();
|
||||
if ((*records)[orig_name].path.isEmpty())
|
||||
{
|
||||
delete httpMgr;
|
||||
return false;
|
||||
}
|
||||
Record record;
|
||||
record.orig_name = orig_name;
|
||||
record.path = object.value("path").toString();
|
||||
record.img = dir + orig_name + ".svg";
|
||||
record.name = object.value("name").toString();
|
||||
record.version = object.value("version").toString();
|
||||
record.app_id=object.value("app_id").toString();
|
||||
record.locked=object.value("locked").toBool();
|
||||
record.type=object.value("type").toString();
|
||||
record.category_id=object.value("category_id").toString();
|
||||
record.status=object.value("status").toBool();
|
||||
record.op=object.value("op").toString();
|
||||
record.func=object.value("func").toString();
|
||||
record.initial_position=object.value("initial_position").toString();
|
||||
record.url=object.value("url").toString();
|
||||
record.logo=object.value("logo").toString();
|
||||
record.img=object.value("img").toString();
|
||||
record.is_navbar=object.value("is_navbar").toBool();
|
||||
record.is_elite=object.value("is_elite").toBool();
|
||||
records->insert(orig_name, record);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@ -734,9 +754,11 @@ QString OpenWeChatRequest::sendRequest(bool notuse)
|
||||
//启动循环
|
||||
eventLoop.exec();
|
||||
timer->stop();
|
||||
qDebug() << reply->error();
|
||||
QByteArray buffer = reply->readAll();
|
||||
QJsonDocument reply_json = QJsonDocument::fromJson(buffer);
|
||||
if(!reply_json.isObject())
|
||||
|
||||
if(!reply_json.isObject())
|
||||
{
|
||||
delete timer;
|
||||
delete httpMgr;
|
||||
@ -745,7 +767,6 @@ QString OpenWeChatRequest::sendRequest(bool notuse)
|
||||
}
|
||||
delete timer;
|
||||
delete httpMgr;
|
||||
delete reply;
|
||||
return reply_json.object().value("msg").toString();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user