mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
优化sdk-nodejs以下功能:
1、新增同步请求方式(executeSync、executeTokenSync); 2、优化请求异常中断问题,返回502错误码; 3、优化签名方法;
This commit is contained in:
@@ -1,35 +1,35 @@
|
||||
const {Class} = require("../common/Class");
|
||||
const {Class} = require('../common/Class');
|
||||
|
||||
/**
|
||||
* 请求类父类
|
||||
*/
|
||||
exports.BaseRequest = Class.create({
|
||||
init: function(){
|
||||
this.bizModel = {}
|
||||
init: function () {
|
||||
this.bizModel = {};
|
||||
/*
|
||||
[
|
||||
{name: 'file1', path: 'd:/dd/1.txt'},
|
||||
{name: 'file2', path: 'd:/dd/2.txt'}
|
||||
]
|
||||
*/
|
||||
this.files = []
|
||||
this.files = [];
|
||||
},
|
||||
/**
|
||||
* 返回接口名称
|
||||
*/
|
||||
getMethod: function() {
|
||||
getMethod: function () {
|
||||
throw `未实现BaseRequest类getMethod()方法`;
|
||||
},
|
||||
/**
|
||||
* 返回版本号
|
||||
*/
|
||||
getVersion: function() {
|
||||
getVersion: function () {
|
||||
throw '未实现BaseRequest类getVersion()方法';
|
||||
},
|
||||
/**
|
||||
* 返回请求类型,使用RequestType.js
|
||||
*/
|
||||
getRequestType: function() {
|
||||
getRequestType: function () {
|
||||
throw '未实现BaseRequest类getRequestType()方法';
|
||||
},
|
||||
/**
|
||||
@@ -40,9 +40,9 @@ exports.BaseRequest = Class.create({
|
||||
parseResponse: function (responseData) {
|
||||
let data = responseData['error_response'];
|
||||
if (!data) {
|
||||
const dataNodeName = this.getMethod().replace(/\./g, '_') + '_response'
|
||||
data = responseData[dataNodeName]
|
||||
const dataNodeName = this.getMethod().replace(/\./g, '_') + '_response';
|
||||
data = responseData[dataNodeName];
|
||||
}
|
||||
return data;
|
||||
}
|
||||
})
|
||||
});
|
||||
|
Reference in New Issue
Block a user