add ipcam file

This commit is contained in:
Jay 2017-03-27 14:53:34 +08:00
parent 1df91aac09
commit 37d854334d
3 changed files with 58 additions and 0 deletions

26
route/api/ipcam.js Normal file
View File

@ -0,0 +1,26 @@
const express = require('express');
const router = express.Router();
const rt = require('../ResTool');
const config = require('../../config.json');
const fs = require('fs');
const mysql = require('../../libs/mysql_cls');
const tool = require('../../includes/apiTool');
const exec = require('child_process').exec;
const so = require('../../includes/storeObject');
const crypt = require('../../libs/crypto');
router
.get('/', (req, res, n) => {
// res.db = new mysql();
// res.db.user = config.db.user;
// res.db.password = config.db.pass;
// res.db.host = config.db.host;
// res.db.port = config.db.port;
// res.db.database = config.db.db1;
// res.db.connect();
res.send({ name: 'WebIO IPCam API' });
})
.all('*', rt.send);
module.exports = router;

View File

@ -0,0 +1,14 @@
import React from 'react';
import {} from 'semantic-ui-react';
class IPCamPage extends React.Component{
render(){
return (
null
)
}
}
export default IPCamPage;

View File

@ -0,0 +1,18 @@
import {connect} from 'react-redux';
import {add_dialog_msg, toggle_loading} from '../../actions';
import IPCamPage from '../../components/AdminPage/IPCam';
const mapStateToProps = (state) => ({
i18n: state.i18n
});
const mapDispatchToProps = (dispatch, ownProps) => ({
showDialog: (msg) => {
dispatch(add_dialog_msg(msg));
},
toggleLoading: (flag = false) => {
dispatch(toggle_loading(flag));
}
})
export default connect(mapStateToProps, mapDispatchToProps)(IPCamPage);