From 594dcc9191405caa25f441e2af8eeb96c5103287 Mon Sep 17 00:00:00 2001 From: snoop Date: Tue, 6 Jun 2017 17:45:21 +0900 Subject: [PATCH] Rest fix --- src/ts/components/Rest.tsx | 11 ++++------- webpack.config.js | 2 +- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/ts/components/Rest.tsx b/src/ts/components/Rest.tsx index d8bb548..15abeae 100644 --- a/src/ts/components/Rest.tsx +++ b/src/ts/components/Rest.tsx @@ -12,7 +12,9 @@ export class OFRest { this.obj = { "serviceName": serviceName, "methodName": methodName, - "param": data + "param": { + "model" : JSON.stringify(data) + } }; @@ -22,18 +24,13 @@ export class OFRest { public Call() { - let m :any; - m = { - "model" : this.obj - } - return fetch(url, { method: 'POST', headers: { 'Accept': 'application/json', // mode: 'no-cors' }, - body: JSON.stringify(m) + body: JSON.stringify(this.obj) }) } diff --git a/webpack.config.js b/webpack.config.js index 8d1f2dc..3a72835 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -25,7 +25,7 @@ module.exports = { historyApiFallback: true, contentBase: [__dirname + '/public', __dirname + '/dist', __dirname + '/node_modules'], // match the output path publicPath: '/' ,// match the output `publicPath` - host: '192.168.1.105', + host: '192.168.1.209', port: 9091, stats: { colors: true