feat: 优化客户端跨平台配置和运行态管理
This commit is contained in:
@@ -17,7 +17,10 @@ void HttpHelper::postRequest(const QString& url, const QJsonObject& jsonBody,
|
||||
// Add auth token header
|
||||
QString token = ConfigHelper::instance().getValue("Server", "client_token");
|
||||
req.setRawHeader("X-Client-Token", token.toUtf8());
|
||||
QFile identity(QDir(QApplication::applicationDirPath()).filePath("config/client_identity.dat"));
|
||||
QString identityPath = ConfigHelper::instance().clientIdentityPath();
|
||||
if (!QFile::exists(identityPath))
|
||||
identityPath = QDir(QApplication::applicationDirPath()).filePath("config/client_identity.dat");
|
||||
QFile identity(identityPath);
|
||||
if (identity.open(QIODevice::ReadOnly))
|
||||
req.setRawHeader("X-Device-Credential", identity.readAll().toBase64());
|
||||
|
||||
@@ -64,4 +67,4 @@ void HttpHelper::postRequest(const QString& url, const QJsonObject& jsonBody,
|
||||
|
||||
reply->deleteLater();
|
||||
manager->deleteLater();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user