| 288 | } |
| 289 | } |
| 290 | initGotEnv(t) { |
| 291 | this.got = this.got ? this.got : require("got"); |
| 292 | this.cktough = this.cktough ? this.cktough : require("tough-cookie"); |
| 293 | this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar(); |
| 294 | if (t) { |
| 295 | t.headers = t.headers ? t.headers : {}; |
| 296 | if (typeof t.headers.Cookie === "undefined" && typeof t.cookieJar === "undefined") { |
| 297 | t.cookieJar = this.ckjar; |
| 298 | } |
| 299 | } |
| 300 | } |
| 301 | /** |
| 302 | * @param {Object} options |
| 303 | * @returns {String} 将 Object 对象 转换成 queryStr: key=val&name=senku |