mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-22 15:41:23 +08:00
更新文档
This commit is contained in:
@@ -57,6 +57,39 @@ windows 下使用 git-bash 或者 cmder 等终端执行以下命令:
|
||||
$ set PORT=4000 && node app.js
|
||||
```
|
||||
|
||||
## 可以在Node.js调用
|
||||
v3.31.0后支持Node.js调用,导入的方法为`module`内的文件名,返回内容包含`status`和`body`,`status`为状态码,`body`为请求返回内容,参考`module_example` 文件夹下的 `test.js`
|
||||
```js
|
||||
const { login_cellphone, user_cloud } = require('NeteaseCloudMusicApi')
|
||||
async function main() {
|
||||
try {
|
||||
const result = await login_cellphone({
|
||||
phone: '手机号',
|
||||
password: '密码'
|
||||
})
|
||||
console.log(result)
|
||||
const result2 = await user_cloud({
|
||||
cookie: result.body.cookie // 凭证
|
||||
})
|
||||
console.log(result2.body)
|
||||
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
}
|
||||
main()
|
||||
```
|
||||
|
||||
## 支持 TypeScript
|
||||
```ts
|
||||
// test.ts
|
||||
import { banner } from 'NeteaseCloudMusicApi'
|
||||
banner({ type:0 }).then(res=>{
|
||||
console.log(res)
|
||||
})
|
||||
```
|
||||
|
||||
|
||||
## 使用文档
|
||||
|
||||
[文档地址](https://binaryify.github.io/NeteaseCloudMusicApi)
|
||||
|
||||
Reference in New Issue
Block a user