mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
fix: 单元测试问题修复
This commit is contained in:
parent
2e933b3d61
commit
7fe9d36b73
@ -33,7 +33,7 @@
|
||||
let timer
|
||||
let timestamp = Date.now()
|
||||
const cookie = localStorage.getItem('cookie')
|
||||
this.getLoginStatus(cookie)
|
||||
getLoginStatus(cookie)
|
||||
const res = await axios({
|
||||
url: `/login/qr/key?timestamp=${Date.now()}`,
|
||||
})
|
||||
@ -44,7 +44,7 @@
|
||||
document.querySelector('#qrImg').src = res2.data.data.qrimg
|
||||
|
||||
timer = setInterval(async () => {
|
||||
const statusRes = await this.checkStatus(key)
|
||||
const statusRes = await checkStatus(key)
|
||||
if (statusRes.code === 800) {
|
||||
alert('二维码已过期,请重新获取')
|
||||
clearInterval(timer)
|
||||
@ -53,7 +53,7 @@
|
||||
// 这一步会返回cookie
|
||||
clearInterval(timer)
|
||||
alert('授权登录成功')
|
||||
await this.getLoginStatus(statusRes.cookie)
|
||||
await getLoginStatus(statusRes.cookie)
|
||||
localStorage.setItem('cookie', statusRes.cookie)
|
||||
}
|
||||
}, 3000)
|
||||
|
@ -33,7 +33,7 @@
|
||||
let timer
|
||||
let timestamp = Date.now()
|
||||
const cookie = localStorage.getItem('cookie')
|
||||
this.getLoginStatus(cookie)
|
||||
getLoginStatus(cookie)
|
||||
const res = await axios({
|
||||
url: `/login/qr/key?timestamp=${Date.now()}`,
|
||||
})
|
||||
@ -44,7 +44,7 @@
|
||||
document.querySelector('#qrImg').src = res2.data.data.qrimg
|
||||
|
||||
timer = setInterval(async () => {
|
||||
const statusRes = await this.checkStatus(key)
|
||||
const statusRes = await checkStatus(key)
|
||||
if (statusRes.code === 800) {
|
||||
alert('二维码已过期,请重新获取')
|
||||
clearInterval(timer)
|
||||
@ -53,7 +53,7 @@
|
||||
// 这一步会返回cookie
|
||||
clearInterval(timer)
|
||||
alert('授权登录成功')
|
||||
await this.getLoginStatus(statusRes.cookie)
|
||||
await getLoginStatus(statusRes.cookie)
|
||||
localStorage.setItem('cookie', statusRes.cookie)
|
||||
}
|
||||
}, 3000)
|
||||
|
@ -1,10 +1,12 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
const serverMod = require('./server')
|
||||
|
||||
const tmpPath = require('os').tmpdir()
|
||||
/** @type {import("express").Express & serverMod.ExpressExtension} */
|
||||
let app
|
||||
|
||||
if (!fs.existsSync(path.resolve(tmpPath, 'anonymous_token'))) {
|
||||
fs.writeFileSync(path.resolve(tmpPath, 'anonymous_token'), '', 'utf-8')
|
||||
}
|
||||
const serverMod = require('./server')
|
||||
before(async () => {
|
||||
app = await serverMod.serveNcmApi({})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user