@myassis/gateway 1.0.44 → 1.0.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services/tools/exec.js +0 -18
- package/package.json +1 -1
|
@@ -10,7 +10,6 @@ const path_1 = __importDefault(require("path"));
|
|
|
10
10
|
const os_1 = __importDefault(require("os"));
|
|
11
11
|
const shared_1 = require("@myassis/shared");
|
|
12
12
|
const crypto_1 = __importDefault(require("crypto"));
|
|
13
|
-
const ServiceManager_js_1 = require("../ServiceManager.js");
|
|
14
13
|
const logger = (0, shared_1.getLogger)('exec');
|
|
15
14
|
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
16
15
|
// 待批准的命令缓存:token -> { command, cwd, timeout, sessionId, expiresAt }
|
|
@@ -176,23 +175,6 @@ exports.execTool = {
|
|
|
176
175
|
return;
|
|
177
176
|
}
|
|
178
177
|
}
|
|
179
|
-
// Windows 下通过 Helper 以登录用户身份执行
|
|
180
|
-
if (process.platform === 'win32') {
|
|
181
|
-
try {
|
|
182
|
-
const result = await (0, ServiceManager_js_1.execAsUser)(command, cwd);
|
|
183
|
-
resolve({
|
|
184
|
-
success: result.exitCode === 0,
|
|
185
|
-
output: result.stdout.substring(0, 100000),
|
|
186
|
-
errorMessage: result.stderr.substring(0, 100000),
|
|
187
|
-
exitCode: result.exitCode,
|
|
188
|
-
});
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
catch (e) {
|
|
192
|
-
resolve({ success: false, errorMessage: e?.message || String(e) });
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
178
|
const options = {
|
|
197
179
|
cwd,
|
|
198
180
|
timeout,
|