修复引用
parent
7fe8d8579b
commit
bf74d08d44
7
index.js
7
index.js
|
@ -10,10 +10,11 @@ import { parseCookie } from './lib/cookie.js'
|
|||
import fs from 'iofs'
|
||||
import URL from 'url'
|
||||
import QS from 'querystring'
|
||||
import PATH from 'path'
|
||||
|
||||
var __dirname = path.dirname(URL.fileURLToPath(import.meta.url))
|
||||
var __dirname = PATH.dirname(URL.fileURLToPath(import.meta.url))
|
||||
|
||||
var tmpdir = path.resolve(__dirname, './.tmp/')
|
||||
var tmpdir = PATH.resolve(__dirname, './.tmp/')
|
||||
var encode = encodeURIComponent
|
||||
var decode = decodeURIComponent
|
||||
|
||||
|
@ -40,6 +41,8 @@ export default class Request {
|
|||
|
||||
if (fs.isdir(tmpdir)) {
|
||||
fs.rm(tmpdir)
|
||||
} else {
|
||||
fs.mkdir(tmpdir)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@gm5/request",
|
||||
"version": "1.2.2",
|
||||
"version": "1.2.3",
|
||||
"description": "对Http的request进一步封装, 提供常用的API",
|
||||
"main": "index.js",
|
||||
"author": "yutent",
|
||||
|
|
Loading…
Reference in New Issue