mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
修复 Nodejs 下 cookie 使用格式问题 #812
This commit is contained in:
@@ -2,5 +2,14 @@ module.exports = {
|
||||
toBoolean(val) {
|
||||
if (val === '') return val
|
||||
return val === 'true' || val == '1'
|
||||
},
|
||||
cookieToJson(cookie) {
|
||||
let cookieArr = cookie.split(';');
|
||||
let obj = {}
|
||||
cookieArr.forEach((i) => {
|
||||
let arr = i.split('=');
|
||||
obj[arr[0]] = arr[1];
|
||||
});
|
||||
return obj
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user