mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 05:38:04 +00:00
fix: add netease_api
This commit is contained in:
parent
fc0367c9b4
commit
0b701d23da
304 changed files with 27205 additions and 1 deletions
17
netease_api/util/index.js
Normal file
17
netease_api/util/index.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
module.exports = {
|
||||
toBoolean(val) {
|
||||
if (typeof val === 'boolean') return val
|
||||
if (val === '') return val
|
||||
return val === 'true' || val == '1'
|
||||
},
|
||||
cookieToJson(cookie) {
|
||||
if (!cookie) return {}
|
||||
let cookieArr = cookie.split(';')
|
||||
let obj = {}
|
||||
cookieArr.forEach((i) => {
|
||||
let arr = i.split('=')
|
||||
obj[arr[0]] = arr[1]
|
||||
})
|
||||
return obj
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue