mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-18 06:07:48 +00:00
fix: add netease_api
This commit is contained in:
parent
fc0367c9b4
commit
0b701d23da
304 changed files with 27205 additions and 1 deletions
32
netease_api/test/login.test.js
Normal file
32
netease_api/test/login.test.js
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
const assert = require('assert')
|
||||
const axios = require('axios')
|
||||
const host = global.host || 'http://localhost:3000'
|
||||
|
||||
console.log('注意: 测试登录需在 test/login.test.js 中填写账号密码!!!')
|
||||
const phone = ''
|
||||
const password = ''
|
||||
describe('测试登录是否正常', () => {
|
||||
it('手机登录 code 应该等于200', (done) => {
|
||||
const qs = {
|
||||
phone: process.env.NCM_API_TEST_LOGIN_PHONE || phone || '',
|
||||
password: process.env.NCM_API_TEST_LOGIN_PASSWORD || password || '',
|
||||
}
|
||||
|
||||
axios
|
||||
.get(`${host}/login/cellphone`, {
|
||||
params: qs,
|
||||
})
|
||||
.then(({ status, data }) => {
|
||||
if (status == 200) {
|
||||
console.log('昵称:' + data.profile.nickname)
|
||||
assert(data.code === 200)
|
||||
done()
|
||||
} else {
|
||||
done('登录错误')
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
done(err)
|
||||
})
|
||||
})
|
||||
})
|
||||
Loading…
Add table
Add a link
Reference in a new issue