Skip to content

Commit 3a766b4

Browse files
committed
修复cookieKey找不到问题
1 parent c93e0ed commit 3a766b4

1 file changed

Lines changed: 22 additions & 26 deletions

File tree

‎neteasemusic/quanx/neteasemusic.js‎

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -12,46 +12,42 @@
1212
*/
1313

1414
function sign() {
15-
const cookieName = "网易云音乐";
16-
const ccookieKey = "chavy_cookie_neteasemusic";
17-
const cookieVal = $prefs.valueForKey(cookieKey);
15+
const cookieName = '网易云音乐'
16+
const cookieKey = 'chavy_cookie_neteasemusic'
17+
const cookieVal = $prefs.valueForKey(cookieKey)
1818

19-
const pc = `http://music.163.com/api/point/dailyTask?type=1`;
20-
const mobile = `http://music.163.com/api/point/dailyTask?type=0`;
19+
const pc = `http://music.163.com/api/point/dailyTask?type=1`
20+
const mobile = `http://music.163.com/api/point/dailyTask?type=0`
2121

2222
let url = {
2323
url: null,
2424
headers: {
2525
Cookie: cookieVal
2626
}
27-
};
28-
url.url = pc;
29-
$task.fetch(url).then(response => {
30-
log("网易云音乐(PC端)", response.body);
31-
});
27+
}
28+
url.url = pc
29+
$task.fetch(url).then((response) => {
30+
log('网易云音乐(PC端)', response.body)
31+
})
3232

33-
url.url = mobile;
34-
$task.fetch(url).then(response => {
35-
log("网易云音乐(移动端)", response.body);
36-
});
33+
url.url = mobile
34+
$task.fetch(url).then((response) => {
35+
log('网易云音乐(移动端)', response.body)
36+
})
3737
}
3838

3939
function log(title, data) {
40-
let result = JSON.parse(data);
40+
let result = JSON.parse(data)
4141
if (result.code == 200) {
42-
console.log(`签到成功: ${title}`);
43-
$notify("签到成功", title, "");
42+
console.log(`签到成功: ${title}`)
43+
$notify('签到成功', title, '')
4444
} else if (result.code == -2) {
45-
console.log(
46-
`签到跳过: ${title}, 编码: ${result.code}, 原因: ${result.msg}`
47-
);
48-
$notify("签到跳过", title, `原因: ${result.msg}`);
45+
console.log(`签到跳过: ${title}, 编码: ${result.code}, 原因: ${result.msg}`)
46+
$notify('签到跳过', title, `原因: ${result.msg}`)
4947
} else {
50-
console.log(
51-
`签到失败: ${title}, 编码: ${result.code}, 原因: ${result.msg}`
52-
);
53-
$notify("签到失败", title, `原因: ${result.msg}`);
48+
console.log(`签到失败: ${title}, 编码: ${result.code}, 原因: ${result.msg}`)
49+
$notify('签到失败', title, `原因: ${result.msg}`)
5450
}
5551
}
5652

57-
sign();
53+
sign()

0 commit comments

Comments
 (0)