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