Skip to content

Commit 71cbc92

Browse files
committed
fix: fix unable to login
修复无法登录的问题 接口时间戳应该使用integer类型,否则会被转成科学计数格式
1 parent 9143bf9 commit 71cbc92

25 files changed

+4728
-6268
lines changed

3rdparty/MelodixAPI/.openapi-generator/FILES

+6-6
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ client/MDGetArtistSingle_200_response.cpp
6060
client/MDGetArtistSingle_200_response.h
6161
client/MDGetArtistSingle_200_response_songs_inner.cpp
6262
client/MDGetArtistSingle_200_response_songs_inner.h
63-
client/MDGetArtistSingle_200_response_songs_inner_al.cpp
64-
client/MDGetArtistSingle_200_response_songs_inner_al.h
65-
client/MDGetArtistSingle_200_response_songs_inner_ar_inner.cpp
66-
client/MDGetArtistSingle_200_response_songs_inner_ar_inner.h
6763
client/MDGetArtistSublist_200_response.cpp
6864
client/MDGetArtistSublist_200_response.h
6965
client/MDGetArtistSublist_200_response_data_inner.cpp
@@ -100,6 +96,8 @@ client/MDGetPlaylistTrackAll_200_response.cpp
10096
client/MDGetPlaylistTrackAll_200_response.h
10197
client/MDGetPlaylistTrackAll_200_response_songs_inner.cpp
10298
client/MDGetPlaylistTrackAll_200_response_songs_inner.h
99+
client/MDGetPlaylistTrackAll_200_response_songs_inner_al.cpp
100+
client/MDGetPlaylistTrackAll_200_response_songs_inner_al.h
103101
client/MDGetPurchasedAlbum_200_response.cpp
104102
client/MDGetPurchasedAlbum_200_response.h
105103
client/MDGetPurchasedAlbum_200_response_paidAlbums_inner.cpp
@@ -203,7 +201,9 @@ client/MDSearch_200_response_result_songs_inner.cpp
203201
client/MDSearch_200_response_result_songs_inner.h
204202
client/MDSearch_200_response_result_songs_inner_al.cpp
205203
client/MDSearch_200_response_result_songs_inner_al.h
206-
client/MDSendCaptcha_200_response.cpp
207-
client/MDSendCaptcha_200_response.h
204+
client/MDSearch_200_response_result_songs_inner_ar_inner.cpp
205+
client/MDSearch_200_response_result_songs_inner_ar_inner.h
208206
client/MDServerConfiguration.h
209207
client/MDServerVariable.h
208+
client/MDVerifyCaptcha_200_response.cpp
209+
client/MDVerifyCaptcha_200_response.h

3rdparty/MelodixAPI/client/CMakeLists.txt

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ add_library(${PROJECT_NAME}
3636
MDGetArtistDetail_200_response_data_vipRights_rightsInfoDetailDtoList_inner.h
3737
MDGetArtistSingle_200_response.h
3838
MDGetArtistSingle_200_response_songs_inner.h
39-
MDGetArtistSingle_200_response_songs_inner_al.h
40-
MDGetArtistSingle_200_response_songs_inner_ar_inner.h
4139
MDGetArtistSublist_200_response.h
4240
MDGetArtistSublist_200_response_data_inner.h
4341
MDGetLikeSongId_200_response.h
@@ -56,6 +54,7 @@ add_library(${PROJECT_NAME}
5654
MDGetPlaylistDetail_200_response_playlist_creator.h
5755
MDGetPlaylistTrackAll_200_response.h
5856
MDGetPlaylistTrackAll_200_response_songs_inner.h
57+
MDGetPlaylistTrackAll_200_response_songs_inner_al.h
5958
MDGetPurchasedAlbum_200_response.h
6059
MDGetPurchasedAlbum_200_response_paidAlbums_inner.h
6160
MDGetQrKey_200_response.h
@@ -103,7 +102,8 @@ add_library(${PROJECT_NAME}
103102
MDSearch_200_response_result.h
104103
MDSearch_200_response_result_songs_inner.h
105104
MDSearch_200_response_result_songs_inner_al.h
106-
MDSendCaptcha_200_response.h
105+
MDSearch_200_response_result_songs_inner_ar_inner.h
106+
MDVerifyCaptcha_200_response.h
107107
MDClientApi.h
108108
MDHelpers.h
109109
MDHttpRequest.h
@@ -141,8 +141,6 @@ add_library(${PROJECT_NAME}
141141
MDGetArtistDetail_200_response_data_vipRights_rightsInfoDetailDtoList_inner.cpp
142142
MDGetArtistSingle_200_response.cpp
143143
MDGetArtistSingle_200_response_songs_inner.cpp
144-
MDGetArtistSingle_200_response_songs_inner_al.cpp
145-
MDGetArtistSingle_200_response_songs_inner_ar_inner.cpp
146144
MDGetArtistSublist_200_response.cpp
147145
MDGetArtistSublist_200_response_data_inner.cpp
148146
MDGetLikeSongId_200_response.cpp
@@ -161,6 +159,7 @@ add_library(${PROJECT_NAME}
161159
MDGetPlaylistDetail_200_response_playlist_creator.cpp
162160
MDGetPlaylistTrackAll_200_response.cpp
163161
MDGetPlaylistTrackAll_200_response_songs_inner.cpp
162+
MDGetPlaylistTrackAll_200_response_songs_inner_al.cpp
164163
MDGetPurchasedAlbum_200_response.cpp
165164
MDGetPurchasedAlbum_200_response_paidAlbums_inner.cpp
166165
MDGetQrKey_200_response.cpp
@@ -208,7 +207,8 @@ add_library(${PROJECT_NAME}
208207
MDSearch_200_response_result.cpp
209208
MDSearch_200_response_result_songs_inner.cpp
210209
MDSearch_200_response_result_songs_inner_al.cpp
211-
MDSendCaptcha_200_response.cpp
210+
MDSearch_200_response_result_songs_inner_ar_inner.cpp
211+
MDVerifyCaptcha_200_response.cpp
212212
MDClientApi.cpp
213213
MDHelpers.cpp
214214
MDHttpRequest.cpp

3rdparty/MelodixAPI/client/MDClientApi.cpp

+19-19
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ void MDClientApi::initializeServerConfigs() {
9595
_serverIndices.insert("qrCreate", 0);
9696
_serverConfigs.insert("search", defaultConf);
9797
_serverIndices.insert("search", 0);
98-
_serverConfigs.insert("sendCaptcha", defaultConf);
99-
_serverIndices.insert("sendCaptcha", 0);
98+
_serverConfigs.insert("sentCaptcha", defaultConf);
99+
_serverIndices.insert("sentCaptcha", 0);
100100
_serverConfigs.insert("verifyCaptcha", defaultConf);
101101
_serverIndices.insert("verifyCaptcha", 0);
102102
}
@@ -593,7 +593,7 @@ void MDClientApi::dailySongRecommendCallback(MDHttpRequestWorker *worker) {
593593
}
594594
}
595595

596-
void MDClientApi::getAccountInfo(const double &timestamp) {
596+
void MDClientApi::getAccountInfo(const qint32 &timestamp) {
597597
QString fullPath = QString(_serverConfigs["getAccountInfo"][_serverIndices.value("getAccountInfo")].URL()+"/user/account");
598598

599599
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
@@ -868,7 +868,7 @@ void MDClientApi::getArtistSingleCallback(MDHttpRequestWorker *worker) {
868868
}
869869
}
870870

871-
void MDClientApi::getArtistSublist(const double &timestamp) {
871+
void MDClientApi::getArtistSublist(const qint32 &timestamp) {
872872
QString fullPath = QString(_serverConfigs["getArtistSublist"][_serverIndices.value("getArtistSublist")].URL()+"/artist/sublist");
873873

874874
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
@@ -998,7 +998,7 @@ void MDClientApi::getLikeSongIdCallback(MDHttpRequestWorker *worker) {
998998
}
999999
}
10001000

1001-
void MDClientApi::getLoginStatus(const double &timestamp) {
1001+
void MDClientApi::getLoginStatus(const qint32 &timestamp) {
10021002
QString fullPath = QString(_serverConfigs["getLoginStatus"][_serverIndices.value("getLoginStatus")].URL()+"/login/status");
10031003

10041004
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
@@ -1418,7 +1418,7 @@ void MDClientApi::getPurchasedAlbumCallback(MDHttpRequestWorker *worker) {
14181418
}
14191419
}
14201420

1421-
void MDClientApi::getQrKey(const double &timestamp) {
1421+
void MDClientApi::getQrKey(const qint32 &timestamp) {
14221422
QString fullPath = QString(_serverConfigs["getQrKey"][_serverIndices.value("getQrKey")].URL()+"/login/qr/key");
14231423

14241424
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
@@ -2096,7 +2096,7 @@ void MDClientApi::getUserPlaylistCallback(MDHttpRequestWorker *worker) {
20962096
}
20972097
}
20982098

2099-
void MDClientApi::likeMusic(const QString &id, const QString &like, const double &timestamp) {
2099+
void MDClientApi::likeMusic(const QString &id, const QString &like, const qint32 &timestamp) {
21002100
QString fullPath = QString(_serverConfigs["likeMusic"][_serverIndices.value("likeMusic")].URL()+"/like");
21012101

21022102
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
@@ -2191,7 +2191,7 @@ void MDClientApi::likeMusicCallback(MDHttpRequestWorker *worker) {
21912191
}
21922192
}
21932193

2194-
void MDClientApi::qrCheck(const QString &key, const double &timestamp) {
2194+
void MDClientApi::qrCheck(const QString &key, const qint32 &timestamp) {
21952195
QString fullPath = QString(_serverConfigs["qrCheck"][_serverIndices.value("qrCheck")].URL()+"/login/qr/check");
21962196

21972197
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
@@ -2271,7 +2271,7 @@ void MDClientApi::qrCheckCallback(MDHttpRequestWorker *worker) {
22712271
}
22722272
}
22732273

2274-
void MDClientApi::qrCreate(const QString &key, const double &timestamp, const ::MelodixAPI::OptionalParam<double> &qrimg) {
2274+
void MDClientApi::qrCreate(const QString &key, const qint32 &timestamp, const ::MelodixAPI::OptionalParam<double> &qrimg) {
22752275
QString fullPath = QString(_serverConfigs["qrCreate"][_serverIndices.value("qrCreate")].URL()+"/login/qr/create");
22762276

22772277
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
@@ -2476,8 +2476,8 @@ void MDClientApi::searchCallback(MDHttpRequestWorker *worker) {
24762476
}
24772477
}
24782478

2479-
void MDClientApi::sendCaptcha(const double &phone, const ::MelodixAPI::OptionalParam<double> &ctcode) {
2480-
QString fullPath = QString(_serverConfigs["sendCaptcha"][_serverIndices.value("sendCaptcha")].URL()+"/captcha/sent");
2479+
void MDClientApi::sentCaptcha(const double &phone, const ::MelodixAPI::OptionalParam<double> &ctcode) {
2480+
QString fullPath = QString(_serverConfigs["sentCaptcha"][_serverIndices.value("sentCaptcha")].URL()+"/captcha/sent");
24812481

24822482
QString queryPrefix, querySuffix, queryDelimiter, queryStyle;
24832483

@@ -2526,7 +2526,7 @@ void MDClientApi::sendCaptcha(const double &phone, const ::MelodixAPI::OptionalP
25262526
}
25272527
#endif
25282528

2529-
connect(worker, &MDHttpRequestWorker::on_execution_finished, this, &MDClientApi::sendCaptchaCallback);
2529+
connect(worker, &MDHttpRequestWorker::on_execution_finished, this, &MDClientApi::sentCaptchaCallback);
25302530
connect(this, &MDClientApi::abortRequestsSignal, worker, &QObject::deleteLater);
25312531
connect(worker, &QObject::destroyed, this, [this]() {
25322532
if (findChildren<MDHttpRequestWorker*>().count() == 0) {
@@ -2537,22 +2537,22 @@ void MDClientApi::sendCaptcha(const double &phone, const ::MelodixAPI::OptionalP
25372537
worker->execute(&input);
25382538
}
25392539

2540-
void MDClientApi::sendCaptchaCallback(MDHttpRequestWorker *worker) {
2540+
void MDClientApi::sentCaptchaCallback(MDHttpRequestWorker *worker) {
25412541
QString error_str = worker->error_str;
25422542
QNetworkReply::NetworkError error_type = worker->error_type;
25432543

25442544
if (worker->error_type != QNetworkReply::NoError) {
25452545
error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response));
25462546
}
2547-
MDSendCaptcha_200_response output(QString(worker->response));
2547+
MDVerifyCaptcha_200_response output(QString(worker->response));
25482548
worker->deleteLater();
25492549

25502550
if (worker->error_type == QNetworkReply::NoError) {
2551-
emit sendCaptchaSignal(output);
2552-
emit sendCaptchaSignalFull(worker, output);
2551+
emit sentCaptchaSignal(output);
2552+
emit sentCaptchaSignalFull(worker, output);
25532553
} else {
2554-
emit sendCaptchaSignalE(output, error_type, error_str);
2555-
emit sendCaptchaSignalEFull(worker, error_type, error_str);
2554+
emit sentCaptchaSignalE(output, error_type, error_str);
2555+
emit sentCaptchaSignalEFull(worker, error_type, error_str);
25562556
}
25572557
}
25582558

@@ -2624,7 +2624,7 @@ void MDClientApi::verifyCaptchaCallback(MDHttpRequestWorker *worker) {
26242624
if (worker->error_type != QNetworkReply::NoError) {
26252625
error_str = QString("%1, %2").arg(worker->error_str, QString(worker->response));
26262626
}
2627-
MDSendCaptcha_200_response output(QString(worker->response));
2627+
MDVerifyCaptcha_200_response output(QString(worker->response));
26282628
worker->deleteLater();
26292629

26302630
if (worker->error_type == QNetworkReply::NoError) {

3rdparty/MelodixAPI/client/MDClientApi.h

+24-24
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#include "MDQrCheck_200_response.h"
4848
#include "MDQrCreate_200_response.h"
4949
#include "MDSearch_200_response.h"
50-
#include "MDSendCaptcha_200_response.h"
50+
#include "MDVerifyCaptcha_200_response.h"
5151
#include <QString>
5252

5353
#include <QObject>
@@ -110,9 +110,9 @@ class MDClientApi : public QObject {
110110
void dailySongRecommend();
111111

112112
/**
113-
* @param[in] timestamp double [required]
113+
* @param[in] timestamp qint32 [required]
114114
*/
115-
void getAccountInfo(const double &timestamp);
115+
void getAccountInfo(const qint32 &timestamp);
116116

117117
/**
118118
* @param[in] id QString [required]
@@ -131,19 +131,19 @@ class MDClientApi : public QObject {
131131
void getArtistSingle(const QString &id);
132132

133133
/**
134-
* @param[in] timestamp double [required]
134+
* @param[in] timestamp qint32 [required]
135135
*/
136-
void getArtistSublist(const double &timestamp);
136+
void getArtistSublist(const qint32 &timestamp);
137137

138138
/**
139139
* @param[in] uid QString [required]
140140
*/
141141
void getLikeSongId(const QString &uid);
142142

143143
/**
144-
* @param[in] timestamp double [required]
144+
* @param[in] timestamp qint32 [required]
145145
*/
146-
void getLoginStatus(const double &timestamp);
146+
void getLoginStatus(const qint32 &timestamp);
147147

148148
/**
149149
* @param[in] id QString [required]
@@ -173,9 +173,9 @@ class MDClientApi : public QObject {
173173
void getPurchasedAlbum(const ::MelodixAPI::OptionalParam<double> &limit = ::MelodixAPI::OptionalParam<double>());
174174

175175
/**
176-
* @param[in] timestamp double [required]
176+
* @param[in] timestamp qint32 [required]
177177
*/
178-
void getQrKey(const double &timestamp);
178+
void getQrKey(const qint32 &timestamp);
179179

180180

181181
void getRecommendResource();
@@ -225,22 +225,22 @@ class MDClientApi : public QObject {
225225
/**
226226
* @param[in] id QString [required]
227227
* @param[in] like QString [required]
228-
* @param[in] timestamp double [required]
228+
* @param[in] timestamp qint32 [required]
229229
*/
230-
void likeMusic(const QString &id, const QString &like, const double &timestamp);
230+
void likeMusic(const QString &id, const QString &like, const qint32 &timestamp);
231231

232232
/**
233233
* @param[in] key QString [required]
234-
* @param[in] timestamp double [required]
234+
* @param[in] timestamp qint32 [required]
235235
*/
236-
void qrCheck(const QString &key, const double &timestamp);
236+
void qrCheck(const QString &key, const qint32 &timestamp);
237237

238238
/**
239239
* @param[in] key QString [required]
240-
* @param[in] timestamp double [required]
240+
* @param[in] timestamp qint32 [required]
241241
* @param[in] qrimg double [optional]
242242
*/
243-
void qrCreate(const QString &key, const double &timestamp, const ::MelodixAPI::OptionalParam<double> &qrimg = ::MelodixAPI::OptionalParam<double>());
243+
void qrCreate(const QString &key, const qint32 &timestamp, const ::MelodixAPI::OptionalParam<double> &qrimg = ::MelodixAPI::OptionalParam<double>());
244244

245245
/**
246246
* @param[in] keywords QString [required]
@@ -254,7 +254,7 @@ class MDClientApi : public QObject {
254254
* @param[in] phone double [required]
255255
* @param[in] ctcode double [optional]
256256
*/
257-
void sendCaptcha(const double &phone, const ::MelodixAPI::OptionalParam<double> &ctcode = ::MelodixAPI::OptionalParam<double>());
257+
void sentCaptcha(const double &phone, const ::MelodixAPI::OptionalParam<double> &ctcode = ::MelodixAPI::OptionalParam<double>());
258258

259259
/**
260260
* @param[in] phone double [required]
@@ -315,7 +315,7 @@ class MDClientApi : public QObject {
315315
void qrCheckCallback(MDHttpRequestWorker *worker);
316316
void qrCreateCallback(MDHttpRequestWorker *worker);
317317
void searchCallback(MDHttpRequestWorker *worker);
318-
void sendCaptchaCallback(MDHttpRequestWorker *worker);
318+
void sentCaptchaCallback(MDHttpRequestWorker *worker);
319319
void verifyCaptchaCallback(MDHttpRequestWorker *worker);
320320

321321
signals:
@@ -350,8 +350,8 @@ class MDClientApi : public QObject {
350350
void qrCheckSignal(MDQrCheck_200_response summary);
351351
void qrCreateSignal(MDQrCreate_200_response summary);
352352
void searchSignal(MDSearch_200_response summary);
353-
void sendCaptchaSignal(MDSendCaptcha_200_response summary);
354-
void verifyCaptchaSignal(MDSendCaptcha_200_response summary);
353+
void sentCaptchaSignal(MDVerifyCaptcha_200_response summary);
354+
void verifyCaptchaSignal(MDVerifyCaptcha_200_response summary);
355355

356356
void bannerSignalFull(MDHttpRequestWorker *worker, MDBanner_200_response summary);
357357
void cellphoneLoginSignalFull(MDHttpRequestWorker *worker, MDCellphoneLogin_200_response summary);
@@ -383,8 +383,8 @@ class MDClientApi : public QObject {
383383
void qrCheckSignalFull(MDHttpRequestWorker *worker, MDQrCheck_200_response summary);
384384
void qrCreateSignalFull(MDHttpRequestWorker *worker, MDQrCreate_200_response summary);
385385
void searchSignalFull(MDHttpRequestWorker *worker, MDSearch_200_response summary);
386-
void sendCaptchaSignalFull(MDHttpRequestWorker *worker, MDSendCaptcha_200_response summary);
387-
void verifyCaptchaSignalFull(MDHttpRequestWorker *worker, MDSendCaptcha_200_response summary);
386+
void sentCaptchaSignalFull(MDHttpRequestWorker *worker, MDVerifyCaptcha_200_response summary);
387+
void verifyCaptchaSignalFull(MDHttpRequestWorker *worker, MDVerifyCaptcha_200_response summary);
388388

389389
void bannerSignalE(MDBanner_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
390390
void cellphoneLoginSignalE(MDCellphoneLogin_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
@@ -416,8 +416,8 @@ class MDClientApi : public QObject {
416416
void qrCheckSignalE(MDQrCheck_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
417417
void qrCreateSignalE(MDQrCreate_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
418418
void searchSignalE(MDSearch_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
419-
void sendCaptchaSignalE(MDSendCaptcha_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
420-
void verifyCaptchaSignalE(MDSendCaptcha_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
419+
void sentCaptchaSignalE(MDVerifyCaptcha_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
420+
void verifyCaptchaSignalE(MDVerifyCaptcha_200_response summary, QNetworkReply::NetworkError error_type, QString error_str);
421421

422422
void bannerSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
423423
void cellphoneLoginSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
@@ -449,7 +449,7 @@ class MDClientApi : public QObject {
449449
void qrCheckSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
450450
void qrCreateSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
451451
void searchSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
452-
void sendCaptchaSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
452+
void sentCaptchaSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
453453
void verifyCaptchaSignalEFull(MDHttpRequestWorker *worker, QNetworkReply::NetworkError error_type, QString error_str);
454454

455455
void abortRequestsSignal();

0 commit comments

Comments
 (0)