mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-22 07:31:23 +08:00
优化代码
This commit is contained in:
+13
-13
@@ -1,20 +1,20 @@
|
||||
const assert = require('assert')
|
||||
const crypto = require('crypto')
|
||||
const { createWebAPIRequest } = require("../util/util")
|
||||
const { createWebAPIRequest } = require('../util/util')
|
||||
|
||||
console.log("注意:测试登陆需要替换这里的账号密码!!!")
|
||||
console.log('注意:测试登陆需要替换这里的账号密码!!!')
|
||||
|
||||
describe('测试登录是否正常', () => {
|
||||
it('手机登录 code 应该等于200', done => {
|
||||
const phone = "换成你的手机号"
|
||||
const password = "换成你的密码"
|
||||
const phone = '换成你的手机号'
|
||||
const password = '换成你的密码'
|
||||
let cookie = ''
|
||||
const md5sum = crypto.createHash('md5')
|
||||
md5sum.update(password)
|
||||
const data = {
|
||||
'phone': phone,
|
||||
'password': md5sum.digest('hex'),
|
||||
'rememberLogin': 'true'
|
||||
phone: phone,
|
||||
password: md5sum.digest('hex'),
|
||||
rememberLogin: 'true'
|
||||
}
|
||||
|
||||
createWebAPIRequest(
|
||||
@@ -38,15 +38,15 @@ describe('测试登录是否正常', () => {
|
||||
})
|
||||
|
||||
it('邮箱登录 code 应该等于200', done => {
|
||||
const email = "换成你的163网易邮箱"
|
||||
const password = "换成你的密码"
|
||||
const email = '换成你的163网易邮箱'
|
||||
const password = '换成你的密码'
|
||||
const cookie = ''
|
||||
const md5sum = crypto.createHash('md5')
|
||||
md5sum.update(password)
|
||||
const data = {
|
||||
'username': email,
|
||||
'password': md5sum.digest('hex'),
|
||||
'rememberLogin': 'true'
|
||||
username: email,
|
||||
password: md5sum.digest('hex'),
|
||||
rememberLogin: 'true'
|
||||
}
|
||||
|
||||
createWebAPIRequest(
|
||||
@@ -68,4 +68,4 @@ describe('测试登录是否正常', () => {
|
||||
err => done(err)
|
||||
)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user