Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
let rqtest = (method, url, data, options) => {
uatest(options.ua)
}
let uatest = (ua = false) => {
console.log(ua)
}
rqtest('POST', 'xxx', {
type: 111
}, {
crypto: 'weapi',
//ua: 'mobile',
cookie: 'cookie123',
proxy: 'proxy123',
realIP: 'realip123',
})
rqtest('POST', 'xxx', {
type: 111
}, {
crypto: 'weapi',
ua: 'mobile',
cookie: 'cookie123',
proxy: 'proxy123',
realIP: 'realip123',
})
rqtest('POST', 'xxx', {
type: 111
}, {
crypto: 'weapi',
ua: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36',
cookie: 'cookie123',
proxy: 'proxy123',
realIP: 'realip123',
})
@makeding
Copy link
Author

makeding commented Sep 11, 2020

运行结果

> node test.js
false
mobile
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.30 Safari/537.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment