修复引用

v1
宇天 2020-09-28 09:53:46 +08:00
parent 7fe8d8579b
commit bf74d08d44
2 changed files with 6 additions and 3 deletions

View File

@ -10,10 +10,11 @@ import { parseCookie } from './lib/cookie.js'
import fs from 'iofs' import fs from 'iofs'
import URL from 'url' import URL from 'url'
import QS from 'querystring' 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 encode = encodeURIComponent
var decode = decodeURIComponent var decode = decodeURIComponent
@ -40,6 +41,8 @@ export default class Request {
if (fs.isdir(tmpdir)) { if (fs.isdir(tmpdir)) {
fs.rm(tmpdir) fs.rm(tmpdir)
} else {
fs.mkdir(tmpdir)
} }
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "@gm5/request", "name": "@gm5/request",
"version": "1.2.2", "version": "1.2.3",
"description": "对Http的request进一步封装, 提供常用的API", "description": "对Http的request进一步封装, 提供常用的API",
"main": "index.js", "main": "index.js",
"author": "yutent", "author": "yutent",