| 353 | } |
| 354 | } |
| 355 | initGotEnv(t) { |
| 356 | this.got = this.got ? this.got : require("got"); |
| 357 | this.cktough = this.cktough ? this.cktough : require("tough-cookie"); |
| 358 | this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar(); |
| 359 | if (t) { |
| 360 | t.headers = t.headers ? t.headers : {}; |
| 361 | if (typeof t.headers.Cookie === "undefined" && typeof t.cookieJar === "undefined") { |
| 362 | t.cookieJar = this.ckjar; |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | /** |
| 367 | * @param {Object} options |
| 368 | * @returns {String} 将 Object 对象 转换成 queryStr: key=val&name=senku |