mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 12:52:04 +08:00
添加服务器url配置功能
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
#include "sparkapi.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
QString SparkAPI::serverUrl = "";
|
||||
|
||||
SparkAPI::SparkAPI(QObject *parent) : QObject(parent)
|
||||
{
|
||||
|
||||
SparkAPI::serverUrl = "https://cdn.d.store.deepinos.org.cn/";
|
||||
}
|
||||
void SparkAPI::get(QUrl url)
|
||||
{
|
||||
@@ -41,9 +44,13 @@ void SparkAPI::getAppInfo(QUrl spk)
|
||||
}
|
||||
QString SparkAPI::getServerUrl()
|
||||
{
|
||||
return "https://cdn.d.store.deepinos.org.cn/";
|
||||
return SparkAPI::serverUrl;
|
||||
}
|
||||
QString SparkAPI::getImgServerUrl()
|
||||
{
|
||||
return "https://cdn.d.store.deepinos.org.cn/";
|
||||
return SparkAPI::serverUrl;
|
||||
}
|
||||
void SparkAPI::setServerUrl(QString url)
|
||||
{
|
||||
SparkAPI::serverUrl = url;
|
||||
}
|
||||
|
||||
@@ -12,11 +12,16 @@ class SparkAPI : public QObject
|
||||
public:
|
||||
static QString getServerUrl();
|
||||
static QString getImgServerUrl();
|
||||
static void setServerUrl(QString url);
|
||||
void getSearchList(QString keyword);
|
||||
void get(QUrl url);
|
||||
void getAppList(QString type);
|
||||
void getAppInfo(QUrl spk);
|
||||
explicit SparkAPI(QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
static QString serverUrl;
|
||||
|
||||
signals:
|
||||
void finished(QJsonArray);
|
||||
void finishedObject(QJsonObject);
|
||||
|
||||
Reference in New Issue
Block a user