This commit is contained in:
朱子楚\zhuzi 2023-09-08 01:12:20 +08:00
parent 573898149a
commit 249c294926
3 changed files with 9 additions and 6 deletions

View File

@ -60,7 +60,6 @@ FluContentPage{
onCache: onCache:
(result)=>{ (result)=>{
text_info.text = result text_info.text = result
console.debug(result)
} }
} }

View File

@ -61,7 +61,6 @@ FluContentPage{
onCache: onCache:
(result)=>{ (result)=>{
text_info.text = result text_info.text = result
console.debug(result)
} }
} }

View File

@ -21,8 +21,9 @@ HttpRequest::HttpRequest(QObject *parent)
QMap<QString, QVariant> HttpRequest::toMap(){ QMap<QString, QVariant> HttpRequest::toMap(){
QVariant _params; QVariant _params;
bool isPostString = method() == "postString";
if(params().isNull()){ if(params().isNull()){
if(method() == "postString"){ if(isPostString){
_params = ""; _params = "";
}else{ }else{
_params = QMap<QString,QVariant>(); _params = QMap<QString,QVariant>();
@ -38,16 +39,20 @@ QMap<QString, QVariant> HttpRequest::toMap(){
} }
QMap<QString, QVariant> request = { QMap<QString, QVariant> request = {
{"url",url()}, {"url",url()},
{"params",_params}, {"headers",_headers.toMap()},
{"headers",_headers},
{"method",method()}, {"method",method()},
{"downloadSavePath",downloadSavePath()} {"downloadSavePath",downloadSavePath()}
}; };
if(isPostString){
request.insert("params",_params.toString());
}else{
request.insert("params",_params.toMap());
}
return request; return request;
} }
QString HttpRequest::httpId(){ QString HttpRequest::httpId(){
return FluTools::getInstance()->sha256(QJsonDocument::fromVariant(QVariant(toMap())).toJson()); return FluTools::getInstance()->sha256(QJsonDocument::fromVariant(QVariant(toMap())).toJson(QJsonDocument::Compact));
} }
HttpCallable::HttpCallable(QObject *parent) HttpCallable::HttpCallable(QObject *parent)