Browse Source

add user-agent for axios options

master
filesite 2 months ago
parent
commit
7b5bef62a1
  1. 4
      lib/heroBot.mjs

4
lib/heroBot.mjs

@ -42,6 +42,10 @@ class HeroBot { @@ -42,6 +42,10 @@ class HeroBot {
//axios请求配置
this.axiosConfig = {
//配置一个浏览器的user-agent
headers: {
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'
},
timeout: 8000, //请求超时
proxy: false //是否走代理
};

Loading…
Cancel
Save