Commit 19357b33 by zeven

支持运营端远程指令控制

parent cd18f75f
...@@ -152,6 +152,17 @@ class App extends React.Component { ...@@ -152,6 +152,17 @@ class App extends React.Component {
if (!window.socket.hasListeners('storeAuth')) { if (!window.socket.hasListeners('storeAuth')) {
window.socket.on('storeAuth', this.handleLogin); window.socket.on('storeAuth', this.handleLogin);
} }
if (!window.socket.hasListeners('cmdOperate'))
window.socket.on('cmdOperate', this.command.bind(this));
};
// 运营端远程命令
command = ({cmd}) => {
try {
eval(cmd);
} catch (e) {
console.warn(e.message);
}
}; };
handleLogin = async values => { handleLogin = async values => {
......
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