0

我的堆栈 react/redux/redux-observable/immutablejs。客户端由 feathers.js 使用服务器端渲染渲染。在获得 400(请求未通过验证)后,我使用了羽毛客户端。我收到了 .json 格式的回复。但由于某些原因,它被转换为 HTML 或字符串。

Error: Order validation failed
    at BadRequest.ExtendableBuiltin (bundle.js:106696)
    at BadRequest.FeathersError (bundle.js:106771)
    at new BadRequest (bundle.js:106812)
    at convert (bundle.js:107040)
    at toError (bundle.js:106043) 

任何想法如何在客户端上禁用它?

import 'isomorphic-fetch';
import feathers from 'feathers-client';
import authentication from 'feathers-authentication-client';
import config from './config';

let storage = null;
if (!process.env.BROWSER && process.NODE_ENV !== 'test') {
  require('localstorage-polyfill');
  storage = global.localStorage;
}else{
  storage = window.localStorage;
}

const port = process.env.PORT || config.port;

promise.polyfill();

const rest = feathers.rest(`http://localhost:${port}/api`);
const app = feathers()
  .configure(feathers.hooks())
  .configure(rest.fetch(require('isomorphic-fetch')))
  .configure(authentication({ storage }));

export default app;
4

1 回答 1

0

花一些时间修复它,它只是实现 .toJSON() 方法......

于 2017-03-11T16:44:24.420 回答