MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / transformResult

Method transformResult

src/common/iServer/MapService.js:84–94  ·  view source on GitHub ↗

* @function MapService.prototype.transformResult * @description 状态完成时转换结果。 * @param {Object} result - 服务器返回的结果对象。 * @param {Object} options - 请求参数。 * @return {Object} 转换结果。

(result, options)

Source from the content-addressed store, hash-verified

82 * @return {Object} 转换结果。
83 */
84 transformResult(result, options) {
85 result = Util.transformResult(result);
86 var codeStatus = (result.code >= 200 && result.code < 300) || result.code == 0 || result.code === 304;
87 var isCodeValid = result.code && codeStatus;
88 if (!result.code || isCodeValid) {
89 return {result: result, options};
90 } else {
91 ////在没有token是返回的是200,但是其实是没有权限,所以这里也应该是触发失败事件
92 return {error: result, options};
93 }
94 }
95}
96

Callers 2

UtilSpec.jsFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected