Skip to content

Commit

Permalink
refactor:代码优化
Browse files Browse the repository at this point in the history
  • Loading branch information
overwriter committed Jan 6, 2024
1 parent b948bbc commit ce3918f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions QCloudMusicApi/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
#define APICPP(FUNCNAME) \
const QVariantMap NeteaseCloudMusicApi::FUNCNAME(QVariantMap query)

static auto request = Request::createRequest;
static auto POST = QNetworkAccessManager::PostOperation;
static auto GET = QNetworkAccessManager::GetOperation;
const static auto request = Request::createRequest;
const static auto POST = QNetworkAccessManager::PostOperation;
const static auto GET = QNetworkAccessManager::GetOperation;

// 初始化名字
APICPP(activate_init_profile) {
Expand Down
2 changes: 1 addition & 1 deletion QCloudMusicApi/request.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ static auto createRequest(QNetworkAccessManager::Operation method, QString urlSt
qDebug().noquote() << QJsonDocument::fromVariant(headers).toJson();

// 发送HTTP请求,并返回一个QNetworkReply对象
auto getResult = [&](QNetworkReply* reply) {
auto getResult = [&](QNetworkReply* reply) -> QVariantMap {
QVariantMap answer {
{ "status", 500 },
{ "body", {} },
Expand Down

0 comments on commit ce3918f

Please sign in to comment.