diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json index 5b15c2b6c9..3aa97aca33 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json @@ -12,6 +12,7 @@ "dependencies": { "acorn": "^6.1.1", "antd": "^3.15.0", + "axios": "^0.18.0", "react": "^16.8.4", "react-dom": "^16.8.4", "react-highlight-words": "^0.16.0", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js index f4faa2a348..d6b1b3fa15 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js @@ -1,6 +1,8 @@ import React from "react"; import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox,} from 'antd'; import styles from './Login.less'; +import axios from 'axios'; + const {Title} = Typography; class Login extends React.Component { @@ -38,26 +40,36 @@ class NormalLoginForm extends React.Component { this.props.form.validateFields((err, values) => { if (!err) { console.log('Received values of form: ', values); + let data = "username="+values.username+"&password="+values.password+"&platform=publisher"; + axios.post('https://localhost:9443/api/application-mgt-handler/v1.0/login', data + ).then(res => { + console.log(res); + console.log(res.data); + }) } + }); - } + }; render() { - const { getFieldDecorator } = this.props.form; + const {getFieldDecorator} = this.props.form; return (
- {getFieldDecorator('userName', { - rules: [{ required: true, message: 'Please input your username!' }], + {getFieldDecorator('username', { + rules: [{required: true, message: 'Please input your username!'}], })( - } placeholder="Username" /> + } + placeholder="Username"/> )} {getFieldDecorator('password', { - rules: [{ required: true, message: 'Please input your Password!' }], + rules: [{required: true, message: 'Please input your Password!'}], })( - } type="password" placeholder="Password" /> + } type="password" + placeholder="Password"/> )} @@ -65,19 +77,18 @@ class NormalLoginForm extends React.Component { valuePropName: 'checked', initialValue: true, })( - Remember me + Remember me.... )} Forgot password - Or register now!
); } } -const WrappedNormalLoginForm = Form.create({ name: 'normal_login' })(NormalLoginForm); +const WrappedNormalLoginForm = Form.create({name: 'normal_login'})(NormalLoginForm); export default Login;