|
|
@ -267,12 +267,10 @@ void WebApplication::doProcessRequest() |
|
|
|
try { |
|
|
|
try { |
|
|
|
const QVariant result = controller->run(action, m_params, data); |
|
|
|
const QVariant result = controller->run(action, m_params, data); |
|
|
|
switch (result.userType()) { |
|
|
|
switch (result.userType()) { |
|
|
|
case QMetaType::QString: |
|
|
|
|
|
|
|
print(result.toString(), Http::CONTENT_TYPE_TXT); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case QMetaType::QJsonDocument: |
|
|
|
case QMetaType::QJsonDocument: |
|
|
|
print(result.toJsonDocument().toJson(QJsonDocument::Compact), Http::CONTENT_TYPE_JSON); |
|
|
|
print(result.toJsonDocument().toJson(QJsonDocument::Compact), Http::CONTENT_TYPE_JSON); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case QMetaType::QString: |
|
|
|
default: |
|
|
|
default: |
|
|
|
print(result.toString(), Http::CONTENT_TYPE_TXT); |
|
|
|
print(result.toString(), Http::CONTENT_TYPE_TXT); |
|
|
|
break; |
|
|
|
break; |
|
|
|