应该完成了
This commit is contained in:
@ -236,7 +236,7 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) {
|
||||
if(result.isObject()){
|
||||
QJsonObject obj_root=result.object();
|
||||
QJsonArray array;
|
||||
|
||||
|
||||
array = obj_root.value("data").toObject().value("menu").toArray();
|
||||
QJsonObject obj_basic = obj_root.value("data").toObject().value("basic").toObject();
|
||||
configResponse->basic.logo_url = obj_basic.value("logo").toString();
|
||||
@ -251,6 +251,7 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) {
|
||||
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("title").toString();
|
||||
button.categroy_id = object.value("category_id").toString();
|
||||
@ -261,6 +262,12 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) {
|
||||
i++;
|
||||
}
|
||||
configResponse->succeed = true;
|
||||
QFile file(QApplication::applicationDirPath() + DEFAULT_NAVBAR_FILLE);
|
||||
if (file.open(QIODevice::Text | QIODevice::WriteOnly))
|
||||
{
|
||||
file.write(result.toJson());
|
||||
file.close();
|
||||
}
|
||||
}else{
|
||||
//<2F><><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>
|
||||
configResponse->succeed=false;
|
||||
@ -584,7 +591,7 @@ DeviceRequest::DeviceRequest() : RequestBodyBase() {
|
||||
eventLoop.exec();
|
||||
delete httpMgr;
|
||||
}
|
||||
bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QString, Record> *records)
|
||||
bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QString, Record> *records, QJsonArray &software_exists)
|
||||
{
|
||||
timer = new QTimer(this);
|
||||
QNetworkAccessManager* httpMgr = new QNetworkAccessManager();
|
||||
@ -611,6 +618,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);
|
||||
obj_root.insert("data", object);
|
||||
obj_root.insert("type", "update");
|
||||
qJsonDocument.setObject(obj_root);
|
||||
@ -669,8 +677,8 @@ bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QStrin
|
||||
QByteArray buffer;
|
||||
delete request_logo;
|
||||
reply->close();
|
||||
QString dir = QApplication::applicationDirPath() + "/images/software/";
|
||||
if (downloadSuccess == true) {
|
||||
QString dir = QApplication::applicationDirPath() + "/images/svg/";
|
||||
if ((reply->error() == QNetworkReply::NoError)&&(downloadSuccess == true)) {
|
||||
buffer = reply->readAll();
|
||||
QFile file(dir + orig_name + ".svg");
|
||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text))
|
||||
@ -704,6 +712,9 @@ bool SoftwareRequest::sendRequest(QHash<QString,QString>&startMenu, QHash<QStrin
|
||||
|
||||
QString OpenWeChatRequest::sendRequest(bool notuse)
|
||||
{
|
||||
QJsonObject obj_root = qJsonDocument.object();
|
||||
obj_root.insert("func", "wxdk");
|
||||
qJsonDocument.setObject(obj_root);
|
||||
timer = new QTimer(this);
|
||||
QNetworkAccessManager* httpMgr = new QNetworkAccessManager();
|
||||
QNetworkRequest requestInfo;
|
||||
@ -727,7 +738,7 @@ QString OpenWeChatRequest::sendRequest(bool notuse)
|
||||
{
|
||||
delete timer;
|
||||
delete httpMgr;
|
||||
delete reply;
|
||||
//delete reply;
|
||||
return "ok";
|
||||
}
|
||||
delete timer;
|
||||
|
Reference in New Issue
Block a user