Skip to content

Commit

Permalink
missing modification
Browse files Browse the repository at this point in the history
  • Loading branch information
nondanee committed May 12, 2019
1 parent d1494a3 commit f24b7e6
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ typings/
.next

# pkg dist directory
dist/
dist/

# es6 transformation
browser/provider
browser/cache.js
2 changes: 1 addition & 1 deletion browser/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const converter = (input, output, processor) => {
fs.writeFileSync(output, data)
}

converter(path.resolve('..', 'cache.js'), path.resolve('.', 'cache.js'))
converter(path.resolve(__dirname, '..', 'cache.js'), path.resolve(__dirname, '.', 'cache.js'))

fs.mkdirSync(path.resolve(__dirname, 'provider'))

Expand Down
4 changes: 2 additions & 2 deletions provider/insure.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ module.exports = () => {
target.route = (target.route || []).concat(property)
return proxy
},
apply: (target, _, arguments) => {
let path = target.route.join('/'), query = arguments[0]
apply: (target, _, payload) => {
let path = target.route.join('/'), query = payload[0]
query = encodeURIComponent(typeof(query) === 'object' ? JSON.stringify(query) : query)
if(path != 'qq/ticket') return Promise.reject()
return request('GET', `${host}/${path}?${query}`)
Expand Down
3 changes: 1 addition & 2 deletions provider/qq.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
const zlib = require('zlib')
const cache = require('../cache')
const insure = require('./insure')
const request = require('../request')
Expand Down Expand Up @@ -121,7 +120,7 @@ const track = id => {
// )
// .then(response => response.body(true))
// .then(body => {
// let xml = zlib.inflateSync(body.slice(5)).toString()
// let xml = require('zlib').inflateSync(body.slice(5)).toString()
// let focus = xml.match(/<item name="(.+)">(.+)<\/item>/)
// return `http://streamoc.music.tc.qq.com/${focus[1]}?vkey=${focus[2]}&guid=0&uin=12345678&fromtag=6`
// })
Expand Down

0 comments on commit f24b7e6

Please sign in to comment.