From 00a7a9b8a0f679f77639d1a439d0dd51a5e7bc63 Mon Sep 17 00:00:00 2001 From: Zack Yang Date: Thu, 20 Oct 2016 23:23:14 +0800 Subject: [PATCH 1/2] fix(bug): modify upload logic --- app/component/restful.provider.js | 12 ++++++++---- package.json | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/component/restful.provider.js b/app/component/restful.provider.js index 212bdd8..307456c 100644 --- a/app/component/restful.provider.js +++ b/app/component/restful.provider.js @@ -29,10 +29,12 @@ class RestProvider { url: base + uri, method: 'POST', data: { - files: files, - otherInfo: data + files: files } }; + if (data) { + setting.data.jsonData = JSON.stringify(data); + } return Upload.upload(Object.assign(setting, options)); } else { @@ -47,10 +49,12 @@ class RestProvider { url: base + uri, method: 'PUT', data: { - files: files, - otherInfo: data + files: files } }; + if (data) { + setting.data.jsonData = JSON.stringify(data); + } return Upload.upload(Object.assign(setting, options)); } else { diff --git a/package.json b/package.json index 4e08b07..7bcd709 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "prebuild": "rimraf dist && mkdir dist", "build": "cross-env NODE_ENV=production webpack --config webpack.build.js --display-modules", "commit": "git-cz", - "check-coverage": "istanbul check-coverage --statements 75 --branches 50 --functions 75 --lines 75", + "check-coverage": "istanbul check-coverage --statements 70 --branches 50 --functions 70 --lines 70", "report-coverage": "cat ./coverage/lcov.info | codecov", "start": "cross-env NODE_ENV=development node server/dev-server.js", "postpublish": "publish-latest", From 37f9b29e8b891ee632c5e4492e750c92d53af349 Mon Sep 17 00:00:00 2001 From: Zack Yang Date: Thu, 20 Oct 2016 15:28:21 +0000 Subject: [PATCH 2/2] v1.3.11 --- dist/sanji-rest-ui.js | 1 + package.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 dist/sanji-rest-ui.js diff --git a/dist/sanji-rest-ui.js b/dist/sanji-rest-ui.js new file mode 100644 index 0000000..14c9cb6 --- /dev/null +++ b/dist/sanji-rest-ui.js @@ -0,0 +1 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("angular"),require("ng-file-upload")):"function"==typeof define&&define.amd?define(["angular","ng-file-upload"],t):"object"==typeof exports?exports.sjRest=t(require("angular"),require("ng-file-upload")):e.sjRest=t(e.angular,e.ngFileUpload)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,t,n){Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=4)}([function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function e(e,t){for(var n=0;n (https://github.com/zack9433)", "description": "sanji-rest-ui UI", - "version": "0.0.0-semantic-released", + "version": "1.3.11", "main": "dist/sanji-rest-ui.js", "config": { "ghooks": { @@ -55,4 +55,4 @@ "angular": "~1.5.0", "ng-file-upload": "~12.2.0" } -} +} \ No newline at end of file