解决兼容性问题

This commit is contained in:
Mike Solar
2023-08-21 15:10:19 +08:00
parent 5ec58b3bfb
commit 9ee232cead
9 changed files with 110 additions and 55 deletions

View File

@ -31,6 +31,8 @@
#pragma comment(lib, "Qt5Network.lib")
#endif
#pragma comment(lib,"comsuppw.lib")
QString background_color;
QString text_color;
//读取注册表获取MachineUUID
bool IsWin11AndLater()
{
@ -187,12 +189,9 @@ RequestBodyBase::RequestBodyBase(){
void ConfigRequest::sendRequest(ConfigResponse *configResponse) {
timer = new QTimer(this);
if(agree)
{
QJsonObject obj_root = qJsonDocument.object();
obj_root.insert("autostart", autostart);
qJsonDocument.setObject(obj_root);
}
QJsonObject obj_root = qJsonDocument.object();
obj_root.insert("autostart", autostart);
qJsonDocument.setObject(obj_root);
QNetworkAccessManager *httpMgr = new QNetworkAccessManager();
QNetworkRequest requestInfo;
@ -238,8 +237,13 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) {
array = obj_root.value("data").toObject().value("menu").toArray();
QJsonObject obj_data = obj_root.value("data").toObject();
QString basic_str= obj_data.value("basic").toString();
QJsonObject obj_basic=QJsonDocument::fromJson(basic_str.toUtf8()).object();
if(!obj_data.value("basic").isObject())
{
configResponse->succeed=false;
delete timer;
return;
}
QJsonObject obj_basic=obj_data.value("basic").toObject();
configResponse->basic.logo_url = obj_basic.value("logo").toString();
configResponse->basic.device_id = obj_basic.value("device_id").toString();
configResponse->basic.dev_id = obj_basic.value("dev_id").toString();
@ -247,6 +251,7 @@ void ConfigRequest::sendRequest(ConfigResponse *configResponse) {
configResponse->basic.backgroud_color = obj_basic.value("backgroud_color").toString();
configResponse->basic.title_color = obj_basic.value("title_color").toString();
configResponse->basic.title_cover_color = obj_basic.value("title_cover_color").toString();
auto i=0;
for(auto value:array){
QJsonObject object=value.toObject();