Commit c46c0e70 by zeven

实现TCP继电器控制

parent 53d2bbe0
android @ bb576ace
Subproject commit 2b9ed2edb9621ec69b594266330522cd3679af2e
Subproject commit bb576ace9f2c3782561d8d3e097374f60adbddf9
......@@ -11,6 +11,7 @@ import models from './models';
import dva from './utils/dva';
import Speech from './utils/Speech';
import Restart from './utils/Restart';
import TcpRelay from './utils/TcpRelay';
import Installer from './utils/Installer';
import {counterInterval} from './utils/authInterval';
import {host} from './utils/config';
......@@ -117,6 +118,11 @@ class App extends React.Component {
Installer.uninstall(pkg);
});
}
if (!window.socket.hasListeners('tcpRelay')) {
window.socket.on('tcpRelay', ({ip, port, route, status}) => {
TcpRelay.toggle(ip, port, route, status);
});
}
};
refresh = async () => {
......
import {NativeModules} from 'react-native';
export default NativeModules.TcpRelay;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment