...
|
...
|
@@ -172,11 +172,19 @@ class PageCahe extends Model { |
|
|
if (self._checkDangerScript(script)) {
|
|
|
self._broadcast(script);
|
|
|
// resolve();
|
|
|
let result = conn.exec(script, (err, stream) => {
|
|
|
if (!err) {
|
|
|
resolve();
|
|
|
} else {
|
|
|
let result = conn.exec('ls', (err, stream) => {
|
|
|
stream.on('data', function(data) {
|
|
|
console.log('STDOUT: ' + data);
|
|
|
}).stderr.on('data', function(data) {
|
|
|
console.log('STDERR: ' + data);
|
|
|
});
|
|
|
if (err) {
|
|
|
self._broadcast('执行错误:${err}');
|
|
|
reject(err);
|
|
|
} else {
|
|
|
stream.on('exit', (code) => {
|
|
|
resolve();
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
} else {
|
...
|
...
|
|