boxjs添加京东极速版UA设置,新的闪购盲盒。

This commit is contained in:
lxk0301
2021-02-24 15:21:24 +08:00
parent df7f3a0c42
commit 0225efaddc
6 changed files with 272 additions and 20 deletions

16
JS_USER_AGENTS.js Normal file
View File

@ -0,0 +1,16 @@
const USER_AGENTS = [
'jdltapp;iPad;3.1.0;14.4;network/wifi;Mozilla/5.0 (iPad; CPU OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148;supportJDSHWK/1',
]
/**
* 生成随机数字
* @param {number} min 最小值(包含)
* @param {number} max 最大值(不包含)
*/
function randomNumber(min = 0, max = 100) {
return Math.min(Math.floor(min + Math.random() * (max - min)), max);
}
const USER_AGENT = USER_AGENTS[randomNumber(0, USER_AGENTS.length)];
module.exports = {
USER_AGENT
}