Skip to content

Commit

Permalink
2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
longjinwen committed Jan 4, 2020
1 parent 35128f1 commit 4186397
Show file tree
Hide file tree
Showing 21 changed files with 1,306 additions and 1,275 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
root = true
[*]
charset = utf-8
indent_size = 4
indent_size = 2

2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
node_modules/
.idea
!dist/php/upload/.*

/server/upload

21 changes: 21 additions & 0 deletions 2.xSrc/http.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Created by WebStorm
* Description: next..
* User: JinwenLong
* Author: longjinwen
* Email: [email protected]
* Date: 2020/1/4
* Time: 3:40 下午
*/


class Http {
constructor() {
}




}

export default Http;
17 changes: 17 additions & 0 deletions 2.xSrc/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Created by WebStorm
* Description: next..
* User: JinwenLong
* Author: longjinwen
* Email: [email protected]
* Date: 2020/1/4
* Time: 3:32 下午
*/



import UploadFile from './upload';

module.exports = UploadFile;


82 changes: 82 additions & 0 deletions 2.xSrc/queue.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/**
* Created by WebStorm
* Description: next..
* User: JinwenLong
* Author: longjinwen
* Email: [email protected]
* Date: 2020/1/4
* Time: 3:36 下午
*/




function Queue() {
var queue = [],
isIng = false,
setIng = function (bo) {
isIng = bo;
},
index = 0,
next = function () {
setIng(false);
exec();
return this;
},
again = function () {
index -= 1;
next();
return this;
},
exec = function () {
if (queue.length > index && isIng === false) {
setIng(true);
queue[index++](next, again);
}
},
arrayProperties = Object.getOwnPropertyNames(Array.prototype);

for (var key in arrayProperties) {
(function (key, _this) {
key = arrayProperties[key];
if (['length', 'constructor'].indexOf(key) > -1) {
return;
}
_this[key] = function () {
return Array.prototype[key].apply(queue, arguments);
};
}(key, this));
}

this.push2queue = function (handle) {
queue.push(handle);
setTimeout(function () {
exec();
}, 0);
return this;
};

this.prev = function () {
index -= 2;
this.next();
return this;
};

this.next = next;

this.again = again;

this.getIndex = function () {
return index;
};

this.getQueue = function () {
return queue;
};

this.empty = function () {
queue = [];
};
}

module.exports = Queue;
17 changes: 17 additions & 0 deletions 2.xSrc/upload.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Created by WebStorm
* Description: next..
* User: JinwenLong
* Author: longjinwen
* Email: [email protected]
* Date: 2020/1/4
* Time: 3:41 下午
*/
class Upload {

}

export default Upload;



117 changes: 0 additions & 117 deletions dist/php/upload.php

This file was deleted.

Empty file removed dist/php/upload/.gitignore
Empty file.
2 changes: 1 addition & 1 deletion dist/simple-upload-slice-file.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/simple-upload-slice-file.min.js.map

Large diffs are not rendered by default.

59 changes: 31 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
{
"name": "simple-upload-slice-file",
"version": "1.0.3",
"description": "一款前端简单的分片上传文件小项目,支持进度计算,队列提交,MD5校验",
"author": "long<[email protected]>",
"main": "./dist/simple-upload-slice-file.min.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack -w",
"build": "webpack -p"
},
"repository": {
"type": "git",
"url": "git://github.com/8696/simple-upload-slice-file.git"
},
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"webpack": "^4.19.0",
"webpack-cli": "^3.1.2"
},
"keywords": [
"web-upload",
"slice-file",
"upload-slice-file"
]
"name": "simple-upload-slice-file",
"version": "1.0.3",
"description": "一款前端简单的分片上传文件小项目,支持进度计算,队列提交,MD5校验",
"author": "long<[email protected]>",
"main": "./dist/simple-upload-slice-file.min.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "webpack -w",
"build": "webpack -p"
},
"repository": {
"type": "git",
"url": "git://github.com/8696/simple-upload-slice-file.git"
},
"license": "ISC",
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.4",
"babel-polyfill": "^6.26.0",
"babel-preset-env": "^1.7.0",
"koa": "^2.11.0",
"koa-bodyparser": "^4.2.1",
"koa-router": "^7.4.0",
"webpack": "^4.19.0",
"webpack-cli": "^3.1.2"
},
"keywords": [
"web-upload",
"slice-file",
"upload-slice-file"
]
}
23 changes: 23 additions & 0 deletions server/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/**
* Created by WebStorm
* Description: next..
* User: JinwenLong
* Author: longjinwen
* Email: [email protected]
* Date: 2020/1/4
* Time: 3:32 下午
*/
const Koa = require('koa');
const app = new Koa();
const router = require('koa-router')();

router.post('/upload', async (ctx) => {
ctx.body = '首页';
});
app.use(router.routes());
app.listen(3000);





Loading

0 comments on commit 4186397

Please sign in to comment.