Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_47285076
NeteaseCloudMusicApi_nicole-n
提交
c05c83db
N
NeteaseCloudMusicApi_nicole-n
项目概览
weixin_47285076
/
NeteaseCloudMusicApi_nicole-n
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
NeteaseCloudMusicApi_nicole-n
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c05c83db
编写于
9月 11, 2020
作者:
H
huggy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
readme 修改成 https 克隆(不用登录 修改 /public 几个测试网页
去掉了 http://localhost:port/ public 里面的网页 lang 都改成 zh 了
上级
9ee30f36
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
243 addition
and
228 deletion
+243
-228
README.MD
README.MD
+1
-1
public/avatar_update.html
public/avatar_update.html
+78
-76
public/index.html
public/index.html
+20
-10
public/playlist_cover_update.html
public/playlist_cover_update.html
+84
-82
public/test.html
public/test.html
+60
-59
未找到文件。
README.MD
浏览文件 @
c05c83db
...
...
@@ -192,7 +192,7 @@
## 安装
```
shell
$
git clone
git@github.com:
Binaryify/NeteaseCloudMusicApi.git
$
git clone
https://github.com/
Binaryify/NeteaseCloudMusicApi.git
$
npm
install
```
...
...
public/avatar_update.html
浏览文件 @
c05c83db
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
更新头像
</title>
</head>
<body>
<input
id=
"file"
type=
"file"
name=
"filename"
/>
<img
id=
"avatar"
style=
"height: 200px; width: 200px; border-radius: 50%;"
/>
<script
src=
"https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js
<html
lang=
"zh"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
更新头像
</title>
</head>
<body>
<input
id=
"file"
type=
"file"
name=
"filename"
/>
<img
id=
"avatar"
style=
"height: 200px; width: 200px; border-radius: 50%;"
/>
<script
src=
"https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js
"
></script>
<script>
const
phone
=
''
const
password
=
''
const
port
=
3000
let
cookieToken
=
''
if
(
!
phone
||
!
password
)
{
const
msg
=
'
请设置你的手机号码和密码
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
<script>
const
phone
=
''
const
password
=
''
let
cookieToken
=
''
if
(
!
phone
||
!
password
)
{
const
msg
=
'
请设置你的手机号码和密码
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
main
()
login
()
async
function
main
()
{
document
.
querySelector
(
'
input[type="file"]
'
).
addEventListener
(
'
change
'
,
function
(
e
)
{
var
file
=
this
.
files
[
0
]
upload
(
file
)
},
false
)
const
res
=
await
axios
({
url
:
`http://localhost:
${
port
}
/user/detail?uid=32953014×tamp=
${
Date
.
now
()}
`
,
withCredentials
:
true
,
//关键
})
document
.
querySelector
(
'
#avatar
'
).
src
=
res
.
data
.
profile
.
avatarUrl
}
async
function
login
()
{
const
res
=
await
axios
({
url
:
`http://localhost:
${
port
}
/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
withCredentials
:
true
,
//关键
})
cookieToken
=
res
.
data
.
cookie
}
async
function
upload
(
file
)
{
var
formData
=
new
FormData
()
formData
.
append
(
'
imgFile
'
,
file
)
const
imgSize
=
await
getImgSize
(
file
)
const
res
=
await
axios
({
method
:
'
post
'
,
url
:
`http://localhost:3000/avatar/upload?cookie=
${
cookieToken
}
&imgSize=
${
imgSize
.
width
}
&imgX=0&imgY=0×tamp=
${
Date
.
now
()}
`
,
headers
:
{
'
Content-Type
'
:
'
multipart/form-data
'
,
},
data
:
formData
,
})
document
.
querySelector
(
'
#avatar
'
).
src
=
res
.
data
.
data
.
url
}
function
getImgSize
(
file
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
function
(
theFile
)
{
let
image
=
new
Image
()
image
.
src
=
theFile
.
target
.
result
image
.
onload
=
function
()
{
resolve
({
width
:
this
.
width
,
height
:
this
.
height
})
}
main
()
login
()
async
function
main
()
{
document
.
querySelector
(
'
input[type="file"]
'
).
addEventListener
(
'
change
'
,
function
(
e
)
{
var
file
=
this
.
files
[
0
]
upload
(
file
)
},
false
)
const
res
=
await
axios
({
url
:
`/user/detail?uid=32953014×tamp=
${
Date
.
now
()}
`
,
withCredentials
:
true
,
//关键
})
document
.
querySelector
(
'
#avatar
'
).
src
=
res
.
data
.
profile
.
avatarUrl
}
async
function
login
()
{
const
res
=
await
axios
({
url
:
`/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
withCredentials
:
true
,
//关键
})
cookieToken
=
res
.
data
.
cookie
}
async
function
upload
(
file
)
{
var
formData
=
new
FormData
()
formData
.
append
(
'
imgFile
'
,
file
)
const
imgSize
=
await
getImgSize
(
file
)
const
res
=
await
axios
({
method
:
'
post
'
,
url
:
`http://localhost:3000/avatar/upload?cookie=
${
cookieToken
}
&imgSize=
${
imgSize
.
width
}
&imgX=0&imgY=0×tamp=
${
Date
.
now
()}
`
,
headers
:
{
'
Content-Type
'
:
'
multipart/form-data
'
,
},
data
:
formData
,
})
document
.
querySelector
(
'
#avatar
'
).
src
=
res
.
data
.
data
.
url
}
function
getImgSize
(
file
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
function
(
theFile
)
{
let
image
=
new
Image
()
image
.
src
=
theFile
.
target
.
result
image
.
onload
=
function
()
{
resolve
({
width
:
this
.
width
,
height
:
this
.
height
})
}
})
}
</script>
</body>
</html>
}
})
}
</script>
</body>
</html>
\ No newline at end of file
public/index.html
浏览文件 @
c05c83db
<!DOCTYPE html>
<html>
<html
lang=
"zh"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<title>
网易云音乐 API
</title>
</head>
<body>
<h1>
网易云音乐 API
</h1>
当你看到这个页面时,这个服务已经成功跑起来了~
...
...
@@ -17,32 +19,40 @@
<li>
3.
<a
href=
"/dj/program?rid=336355127"
>
电台节目
</a></li>
</ul>
<style>
html
,
body
{
html
,
body
{
height
:
100vh
;
width
:
100vw
;
margin
:
0
;
padding
:
0
;
background
:
#ffffff
;
text-align
:
center
;
margin-top
:
30px
;
margin-top
:
30px
;
overflow
:
hidden
;
}
*
{
color
:
rgb
(
100
,
100
,
100
);
*
{
color
:
rgb
(
100
,
100
,
100
);
}
a
{
color
:
#42b983
;
a
{
color
:
#42b983
;
}
ul
,
li
{
ul
,
li
{
margin
:
0
;
}
ul
{
ul
{
margin-left
:
-40px
;
line-height
:
30px
;
}
li
{
li
{
list-style
:
none
;
}
</style>
</body>
</html>
\ No newline at end of file
public/playlist_cover_update.html
浏览文件 @
c05c83db
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
歌单封面上传
</title>
</head>
<body>
<input
id=
"file"
type=
"file"
name=
"filename"
/>
<img
id=
"playlist_cover"
style=
"height: 200px; width: 200px; border-radius: 50%;"
/>
<script
src=
"https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js
<html
lang=
"zh"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<title>
歌单封面上传
</title>
</head>
<body>
<input
id=
"file"
type=
"file"
name=
"filename"
/>
<img
id=
"playlist_cover"
style=
"height: 200px; width: 200px; border-radius: 50%;"
/>
<script
src=
"https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js
"
></script>
<script>
const
phone
=
''
const
password
=
''
const
playlist_id
=
''
const
port
=
3000
let
cookieToken
=
''
if
(
!
phone
||
!
password
)
{
const
msg
=
'
请设置你的手机号码和密码
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
if
(
!
playlist_id
)
{
const
msg
=
'
请设置你的歌单id
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
<script>
const
phone
=
''
const
password
=
''
const
playlist_id
=
''
let
cookieToken
=
''
if
(
!
phone
||
!
password
)
{
const
msg
=
'
请设置你的手机号码和密码
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
if
(
!
playlist_id
)
{
const
msg
=
'
请设置你的歌单id
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
main
()
login
()
async
function
main
()
{
document
.
querySelector
(
'
input[type="file"]
'
).
addEventListener
(
'
change
'
,
function
(
e
)
{
var
file
=
this
.
files
[
0
]
upload
(
file
)
},
false
)
const
res
=
await
axios
({
url
:
`http://localhost:
${
port
}
/playlist/detail?id=
${
playlist_id
}
×tamp=
${
Date
.
now
()}
`
,
})
document
.
querySelector
(
'
#playlist_cover
'
).
src
=
res
.
data
.
playlist
.
coverImgUrl
}
async
function
login
()
{
const
res
=
await
axios
({
url
:
`http://localhost:
${
port
}
/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
withCredentials
:
true
,
//关键
})
cookieToken
=
res
.
data
.
cookie
}
async
function
upload
(
file
)
{
var
formData
=
new
FormData
()
formData
.
append
(
'
imgFile
'
,
file
)
const
imgSize
=
await
getImgSize
(
file
)
const
res
=
await
axios
({
method
:
'
post
'
,
url
:
`http://localhost:3000/playlist/cover/update?id=
${
playlist_id
}
&cookie=
${
cookieToken
}
&imgSize=
${
imgSize
.
width
}
&imgX=0&imgY=0×tamp=
${
Date
.
now
()}
`
,
headers
:
{
'
Content-Type
'
:
'
multipart/form-data
'
,
},
data
:
formData
,
})
document
.
querySelector
(
'
#playlist_cover
'
).
src
=
res
.
data
.
data
.
url
}
function
getImgSize
(
file
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
function
(
theFile
)
{
let
image
=
new
Image
()
image
.
src
=
theFile
.
target
.
result
image
.
onload
=
function
()
{
resolve
({
width
:
this
.
width
,
height
:
this
.
height
,
})
}
main
()
login
()
async
function
main
()
{
document
.
querySelector
(
'
input[type="file"]
'
).
addEventListener
(
'
change
'
,
function
(
e
)
{
var
file
=
this
.
files
[
0
]
upload
(
file
)
},
false
)
const
res
=
await
axios
({
url
:
`/playlist/detail?id=
${
playlist_id
}
×tamp=
${
Date
.
now
()}
`
,
})
document
.
querySelector
(
'
#playlist_cover
'
).
src
=
res
.
data
.
playlist
.
coverImgUrl
}
async
function
login
()
{
const
res
=
await
axios
({
url
:
`/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
withCredentials
:
true
,
//关键
})
cookieToken
=
res
.
data
.
cookie
}
async
function
upload
(
file
)
{
var
formData
=
new
FormData
()
formData
.
append
(
'
imgFile
'
,
file
)
const
imgSize
=
await
getImgSize
(
file
)
const
res
=
await
axios
({
method
:
'
post
'
,
url
:
`http://localhost:3000/playlist/cover/update?id=
${
playlist_id
}
&cookie=
${
cookieToken
}
&imgSize=
${
imgSize
.
width
}
&imgX=0&imgY=0×tamp=
${
Date
.
now
()}
`
,
headers
:
{
'
Content-Type
'
:
'
multipart/form-data
'
,
},
data
:
formData
,
})
document
.
querySelector
(
'
#playlist_cover
'
).
src
=
res
.
data
.
data
.
url
}
function
getImgSize
(
file
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
let
reader
=
new
FileReader
()
reader
.
readAsDataURL
(
file
)
reader
.
onload
=
function
(
theFile
)
{
let
image
=
new
Image
()
image
.
src
=
theFile
.
target
.
result
image
.
onload
=
function
()
{
resolve
({
width
:
this
.
width
,
height
:
this
.
height
,
})
}
})
}
</script>
</body>
</html>
}
})
}
</script>
</body>
</html>
\ No newline at end of file
public/test.html
浏览文件 @
c05c83db
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
/>
<title>
test
</title>
</head>
<html
lang=
"zh"
>
<body>
<p>
请在控制台看结果
</p>
<script
src=
"https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"
></script>
<script
src=
"https://cdn.bootcss.com/axios/0.18.0/axios.min.js"
></script>
<script>
const
phone
=
''
const
password
=
''
const
port
=
3000
if
(
!
phone
||
!
password
){
const
msg
=
'
请设置你的手机号码和密码
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
$
.
ajax
({
url
:
`http://localhost:
${
port
}
/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
xhrFields
:
{
withCredentials
:
true
//关键
},
success
:
function
(
data
)
{
console
.
log
(
data
)
$
.
ajax
({
url
:
`http://localhost:
${
port
}
/recommend/resource `
,
xhrFields
:
{
withCredentials
:
true
//关键
},
success
:
function
(
data
)
{
console
.
log
(
data
)
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
<head>
<meta
charset=
"UTF-8"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
/>
<title>
test
</title>
</head>
axios
({
url
:
`http://localhost:
${
port
}
/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
withCredentials
:
true
//关键
}).
then
(
function
(
res
)
{
console
.
log
(
res
.
data
)
axios
({
url
:
`http://localhost:
${
port
}
/recommend/resource`
,
withCredentials
:
true
//关键
}).
then
(
function
(
res
)
{
console
.
log
(
res
.
data
)
})
})
</script>
</body>
</html>
<body>
<p>
请在控制台看结果
</p>
<script
src=
"https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"
></script>
<script
src=
"https://cdn.bootcss.com/axios/0.18.0/axios.min.js"
></script>
<script>
const
phone
=
''
const
password
=
''
if
(
!
phone
||
!
password
)
{
const
msg
=
'
请设置你的手机号码和密码
'
alert
(
msg
)
throw
new
Error
(
msg
)
}
$
.
ajax
({
url
:
`/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
xhrFields
:
{
withCredentials
:
true
//关键
},
success
:
function
(
data
)
{
console
.
log
(
data
)
$
.
ajax
({
url
:
`/recommend/resource `
,
xhrFields
:
{
withCredentials
:
true
//关键
},
success
:
function
(
data
)
{
console
.
log
(
data
)
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
axios
({
url
:
`/login/cellphone?phone=
${
phone
}
&password=
${
password
}
`
,
withCredentials
:
true
//关键
}).
then
(
function
(
res
)
{
console
.
log
(
res
.
data
)
axios
({
url
:
`/recommend/resource`
,
withCredentials
:
true
//关键
}).
then
(
function
(
res
)
{
console
.
log
(
res
.
data
)
})
})
</script>
</body>
</html>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录