修复依赖问题

This commit is contained in:
binaryify 2020-08-04 09:59:41 +08:00
parent 8e49998a47
commit acb49acab8
4 changed files with 9 additions and 5 deletions

View File

@ -1,4 +1,7 @@
# 更新日志 # 更新日志
### 3.37.1 | 2020.08.04
- 修复依赖问题
### 3.37.0 | 2020.08.03 ### 3.37.0 | 2020.08.03
- 新增`更新头像`,`歌单封面上传`接口和相关例子 [#403](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/403) [#857](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/857) - 新增`更新头像`,`歌单封面上传`接口和相关例子 [#403](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/403) [#857](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/857)
- 加入`axios`依赖 - 加入`axios`依赖

View File

@ -1,6 +1,6 @@
{ {
"name": "NeteaseCloudMusicApi", "name": "NeteaseCloudMusicApi",
"version": "3.37.0", "version": "3.37.1",
"description": "网易云音乐 NodeJS 版 API", "description": "网易云音乐 NodeJS 版 API",
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",
@ -37,6 +37,7 @@
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"express": "^4.17.1", "express": "^4.17.1",
"express-fileupload": "^1.1.9",
"pac-proxy-agent": "^3.0.1", "pac-proxy-agent": "^3.0.1",
"request": "^2.88.0" "request": "^2.88.0"
}, },

View File

@ -33,7 +33,7 @@
false false
) )
const res = await axios({ const res = await axios({
url: `http://localhost:${port}/user/detail?uid=32953014`, url: `http://localhost:${port}/user/detail?uid=32953014&timestamp=${Date.now()}`,
withCredentials: true, //关键 withCredentials: true, //关键
}) })
document.querySelector('#avatar').src = res.data.profile.avatarUrl document.querySelector('#avatar').src = res.data.profile.avatarUrl
@ -51,7 +51,7 @@
const imgSize = await getImgSize(file) const imgSize = await getImgSize(file)
const res = await axios({ const res = await axios({
method: 'post', method: 'post',
url: `http://localhost:3000/avatar/upload?cookie=${cookieToken}&imgSize=${imgSize.width}&imgX=0&imgY=0`, url: `http://localhost:3000/avatar/upload?cookie=${cookieToken}&imgSize=${imgSize.width}&imgX=0&imgY=0&timestamp=${Date.now()}`,
headers: { headers: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
}, },

View File

@ -40,7 +40,7 @@
false false
) )
const res = await axios({ const res = await axios({
url: `http://localhost:${port}/playlist/detail?id=${playlist_id}`, url: `http://localhost:${port}/playlist/detail?id=${playlist_id}&timestamp=${Date.now()}`,
}) })
document.querySelector('#playlist_cover').src = res.data.playlist.coverImgUrl document.querySelector('#playlist_cover').src = res.data.playlist.coverImgUrl
} }
@ -57,7 +57,7 @@
const imgSize = await getImgSize(file) const imgSize = await getImgSize(file)
const res = await axios({ const res = await axios({
method: 'post', method: 'post',
url: `http://localhost:3000/playlist/cover/update?id=${playlist_id}&cookie=${cookieToken}&imgSize=${imgSize.width}&imgX=0&imgY=0`, url: `http://localhost:3000/playlist/cover/update?id=${playlist_id}&cookie=${cookieToken}&imgSize=${imgSize.width}&imgX=0&imgY=0&timestamp=${Date.now()}`,
headers: { headers: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
}, },