Skip to content

Commit

Permalink
feat:增加签到功能
Browse files Browse the repository at this point in the history
  • Loading branch information
overwriter committed Nov 3, 2023
1 parent ac6b9a7 commit 2cb2eb3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
25 changes: 25 additions & 0 deletions QCloudMusicApi/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,31 @@ const QVariantMap NeteaseCloudMusicApi::creator_authinfo_get(QVariantMap query)
);
}

// 签到

/*
0为安卓端签到 3点经验, 1为网页签到,2点经验
签到成功 {'android': {'point': 3, 'code': 200}, 'web': {'point': 2, 'code': 200}}
重复签到 {'android': {'code': -2, 'msg': '重复签到'}, 'web': {'code': -2, 'msg': '重复签到'}}
未登录 {'android': {'code': 301}, 'web': {'code': 301}}
*/
const QVariantMap NeteaseCloudMusicApi::daily_signin(QVariantMap query) {
const QVariantMap data {
{ "type", query.value("type", 0) }
};
return createRequest(
QNetworkAccessManager::PostOperation,
"https://music.163.com/weapi/point/dailyTask",
data,
QVariantMap {
{ "crypto", "weapi" },
{ "cookie", query["cookie"] },
{ "proxy", query["proxy"] },
{ "realIP", query["realIP"] }
}
);
}

// 数字专辑详情
const QVariantMap NeteaseCloudMusicApi::digitalAlbum_detail(QVariantMap query) {
const QVariantMap data {
Expand Down
10 changes: 10 additions & 0 deletions QCloudMusicApi/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,16 @@ class QCLOUDMUSICAPI_EXPORT NeteaseCloudMusicApi: public QObject {
// 获取达人用户信息
Q_INVOKABLE const QVariantMap creator_authinfo_get(QVariantMap query);

// 签到

/*
0为安卓端签到 3点经验, 1为网页签到,2点经验
签到成功 {'android': {'point': 3, 'code': 200}, 'web': {'point': 2, 'code': 200}}
重复签到 {'android': {'code': -2, 'msg': '重复签到'}, 'web': {'code': -2, 'msg': '重复签到'}}
未登录 {'android': {'code': 301}, 'web': {'code': 301}}
*/
Q_INVOKABLE const QVariantMap daily_signin(QVariantMap query);

// 数字专辑详情
Q_INVOKABLE const QVariantMap digitalAlbum_detail(QVariantMap query);

Expand Down

0 comments on commit 2cb2eb3

Please sign in to comment.