qiniu-web-uploader
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "qiniu-web-uploader", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "七牛上传模块", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "jest" | ||
}, | ||
@@ -25,3 +25,3 @@ "repository": { | ||
"devDependencies": { | ||
"babel-cli": "^6.5.1", | ||
"babel-core": "^6.5.2", | ||
"babel-plugin-transform-class-properties": "^6.4.0", | ||
@@ -33,9 +33,20 @@ "babel-plugin-transform-es2015-classes": "^6.4.0", | ||
"babel-preset-stage-0": "^6.3.13", | ||
"babel-runtime": "^6.5.0", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-mocha": "^2.2.0", | ||
"gulp-util": "^3.0.7", | ||
"mocha": "^2.4.5", | ||
"should": "^8.2.2" | ||
"jest-cli": "^0.8.2" | ||
}, | ||
"jest": { | ||
"scriptPreprocessor": "./jest/processor.js", | ||
"testPathIgnorePatterns": [ | ||
"node_modules" | ||
], | ||
"testPathDirs": [ | ||
"__tests__" | ||
], | ||
"unmockedModulePathPatterns": [ | ||
"./node_modules/babel" | ||
] | ||
} | ||
} |
import { EventEmitter } from 'events'; | ||
import Top from '../utils'; | ||
var NODE_QINIU_URL = '//7xme0g.com2.z0.glb.qiniucdn.com/'; | ||
if(process.env.NODE_ENV !== 'production') { | ||
NODE_QINIU_URL = '//7xlh8e.com2.z0.glb.qiniucdn.com/'; | ||
} | ||
let uniqueId = 1; | ||
@@ -17,3 +11,2 @@ export default class QNImageUploaderInfo extends EventEmitter{ | ||
this.__uniqueId = uniqueId ++; | ||
this._lastModifiedDate = Top.formatDate(file.lastModifiedDate, '-', false); | ||
} | ||
@@ -24,5 +17,2 @@ | ||
} | ||
get lastModifiedDate() { | ||
return this._lastModifiedDate; | ||
} | ||
@@ -40,5 +30,2 @@ get percent() { | ||
get imgPath() { | ||
return NODE_QINIU_URL + this._imgKey; | ||
} | ||
//七牛的Key | ||
@@ -45,0 +32,0 @@ set imgKey(v) { |
import Uploader from './core.jsx'; | ||
import { EventEmitter } from 'events'; | ||
import LoaderInfo from './info.jsx'; | ||
import Top, { log } from '../top.jsx'; | ||
@@ -6,0 +5,0 @@ const PARALLEL_NUM = 8; |
@@ -13,4 +13,3 @@ const UPLOAD_URL = 'http://upload.qiniu.com/'; | ||
} | ||
let bb = new Blob([ab]); | ||
return bb; | ||
return new Blob([ab]); | ||
} | ||
@@ -17,0 +16,0 @@ |
35707
12
17
1