Skip to content

Commit 7dc28f4

Browse files
committed
fix put请求 优化ut
1 parent 21bb83b commit 7dc28f4

File tree

10 files changed

+17
-17
lines changed

10 files changed

+17
-17
lines changed

dist/iclient-classic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ var CommonServiceBase = function () {
17971797
}, {
17981798
key: '_commit',
17991799
value: function _commit(options) {
1800-
if (options.method === "POST") {
1800+
if (options.method === "POST" || options.method === "PUT") {
18011801
if (options.params) {
18021802
options.url = _SuperMap2.default.Util.urlAppend(options.url, _SuperMap2.default.Util.getParameterString(options.params || {}));
18031803
}
@@ -1814,7 +1814,7 @@ var CommonServiceBase = function () {
18141814

18151815
if (result.error) {
18161816
var failure = options.scope ? _SuperMap2.default.Function.bind(options.failure, options.scope) : options.failure;
1817-
failure(result.error);
1817+
failure(result);
18181818
} else {
18191819
result.succeed = result.succeed == undefined ? true : result.succeed;
18201820
var success = options.scope ? _SuperMap2.default.Function.bind(options.success, options.scope) : options.success;

dist/iclient-classic.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-leaflet.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ var CommonServiceBase = function () {
16041604
}, {
16051605
key: '_commit',
16061606
value: function _commit(options) {
1607-
if (options.method === "POST") {
1607+
if (options.method === "POST" || options.method === "PUT") {
16081608
if (options.params) {
16091609
options.url = _SuperMap2["default"].Util.urlAppend(options.url, _SuperMap2["default"].Util.getParameterString(options.params || {}));
16101610
}
@@ -1621,7 +1621,7 @@ var CommonServiceBase = function () {
16211621

16221622
if (result.error) {
16231623
var failure = options.scope ? _SuperMap2["default"].Function.bind(options.failure, options.scope) : options.failure;
1624-
failure(result.error);
1624+
failure(result);
16251625
} else {
16261626
result.succeed = result.succeed == undefined ? true : result.succeed;
16271627
var success = options.scope ? _SuperMap2["default"].Function.bind(options.success, options.scope) : options.success;

dist/iclient9-leaflet.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-mapboxgl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,7 +1598,7 @@ var CommonServiceBase = function () {
15981598
}, {
15991599
key: '_commit',
16001600
value: function _commit(options) {
1601-
if (options.method === "POST") {
1601+
if (options.method === "POST" || options.method === "PUT") {
16021602
if (options.params) {
16031603
options.url = _SuperMap2.default.Util.urlAppend(options.url, _SuperMap2.default.Util.getParameterString(options.params || {}));
16041604
}
@@ -1615,7 +1615,7 @@ var CommonServiceBase = function () {
16151615

16161616
if (result.error) {
16171617
var failure = options.scope ? _SuperMap2.default.Function.bind(options.failure, options.scope) : options.failure;
1618-
failure(result.error);
1618+
failure(result);
16191619
} else {
16201620
result.succeed = result.succeed == undefined ? true : result.succeed;
16211621
var success = options.scope ? _SuperMap2.default.Function.bind(options.success, options.scope) : options.success;

dist/iclient9-mapboxgl.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/iclient9-openlayers.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ var CommonServiceBase = function () {
16041604
}, {
16051605
key: '_commit',
16061606
value: function _commit(options) {
1607-
if (options.method === "POST") {
1607+
if (options.method === "POST" || options.method === "PUT") {
16081608
if (options.params) {
16091609
options.url = _SuperMap2.default.Util.urlAppend(options.url, _SuperMap2.default.Util.getParameterString(options.params || {}));
16101610
}
@@ -1621,7 +1621,7 @@ var CommonServiceBase = function () {
16211621

16221622
if (result.error) {
16231623
var failure = options.scope ? _SuperMap2.default.Function.bind(options.failure, options.scope) : options.failure;
1624-
failure(result.error);
1624+
failure(result);
16251625
} else {
16261626
result.succeed = result.succeed == undefined ? true : result.succeed;
16271627
var success = options.scope ? _SuperMap2.default.Function.bind(options.success, options.scope) : options.success;

dist/iclient9-openlayers.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/common/iServer/CommonServiceBase.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ export default class CommonServiceBase {
352352
this.events.triggerEvent("processFailed", {error: error});
353353
}
354354
_commit(options) {
355-
if (options.method === "POST") {
355+
if (options.method === "POST" || options.method === "PUT") {
356356
if (options.params) {
357357
options.url = SuperMap.Util.urlAppend(options.url,
358358
SuperMap.Util.getParameterString(options.params || {}));
@@ -370,7 +370,7 @@ export default class CommonServiceBase {
370370

371371
if(result.error){
372372
var failure = (options.scope) ? SuperMap.Function.bind(options.failure, options.scope) : options.failure;
373-
failure(result.error);
373+
failure(result);
374374
}else{
375375
result.succeed = result.succeed == undefined ? true : result.succeed;
376376
var success = (options.scope) ? SuperMap.Function.bind(options.success, options.scope) : options.success;

test/common/iServer/FindTSPPathsServiceSpec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ describe('testFindTSPPathsService_processAsync',function(){
208208
});
209209

210210
//AnalyzeById_null
211-
it('parameterNull',function(done){
211+
it('AnalyzeById_null',function(done){
212212
var nodeArray = [new SuperMap.Geometry.Point(5627.7550668827, -3627.4849836293),
213213
new SuperMap.Geometry.Point(5018.1469160422, -4638.5424045354),
214214
new SuperMap.Geometry.Point(6133.2837773358,-4645.9766502774)
@@ -223,15 +223,15 @@ describe('testFindTSPPathsService_processAsync',function(){
223223
returnPathGuides: true,
224224
returnRoutes: true
225225
});
226-
var analystParameter = new SuperMap.TransportationAnalystParameter({
226+
var analystParameter1 = new SuperMap.TransportationAnalystParameter({
227227
resultSetting: resultSetting,
228228
weightFieldName: "length"
229229
});
230230
var parameter = new SuperMap.FindTSPPathsParameters({
231231
isAnalyzeById: "AnalyzeById",
232232
nodes: nodeArray,
233233
endNodeAssigned: false,
234-
parameter: analystParameter
234+
parameter: analystParameter1
235235
});
236236
var findTSPPathsService = initFindTSPPathService();
237237
findTSPPathsService.processAsync(parameter);

0 commit comments

Comments
 (0)