我有以下代码:
Addresses.getorderHistory = function(address, baseToken, status, length, cb) {
console.log("lenght here -> " + length);
addressService.getorderHistory(address, baseToken, status, length, cb)
.catch(err => cb(err));
};
Addresses.remoteMethod('getorderHistory', {
http: { verb: 'get', path: '/:address/orderHistory' },
accepts: [
{ arg: "address", type: "string", required: true },
{ arg: "base_token", type: "string", required: true, 'http': {source: 'query'} },
{ arg: "status", type: "string", required: true, 'http': {source: 'query'} },
{ arg: "length", type: "string", required: true, 'http': {source: 'query'} }
],
returns: { type: 'object', root: true }
});
当我这样请求时
curl http://localhost:3001/<my root>/addresses/<my address>/orderHistory?base_token=<my token>&status=filled&length=100
它说
Error: status is a required argument
我基本上可以读取address
和baseToken
的值,但不能读取status
和length
。我想念什么?