⏲ 移除 child_process 依赖, 使用 node 自带模块

This commit is contained in:
hunlongyu
2020-11-11 21:41:39 +08:00
parent 68a0226759
commit 9a7534ba57
3 changed files with 1 additions and 10 deletions

View File

@@ -20,7 +20,6 @@
"axios": "^0.21.0",
"bootstrap-vue": "^2.19.0",
"cheerio": "^1.0.0-rc.3",
"child_process": "^1.0.2",
"core-js": "^3.7.0",
"cors": "^2.8.5",
"dexie": "^3.0.2",

View File

@@ -180,6 +180,7 @@ import Player from 'xgplayer'
import Hls from 'xgplayer-hls.js'
import mt from 'mousetrap'
import { directive as onClickaway } from 'vue-clickaway'
import { exec, execFile } from 'child_process'
const { remote, ipcRenderer, clipboard } = require('electron')
@@ -685,10 +686,8 @@ export default {
return
}
if (fs.existsSync(externalPlayer)) {
var execFile = require('child_process').execFile
execFile(externalPlayer, [this.video.iptv.url])
} else {
var exec = require('child_process').exec
exec(externalPlayer, [this.video.iptv.url])
}
return
@@ -704,10 +703,8 @@ export default {
} else {
var m3uFile = this.generateM3uFile(this.video.info.name, m3u8Arr, this.video.info.index)
if (fs.existsSync(externalPlayer)) {
var execFile = require('child_process').execFile
execFile(externalPlayer, [m3uFile])
} else {
var exec = require('child_process').exec
exec(externalPlayer, [m3uFile])
}
}

View File

@@ -2508,11 +2508,6 @@ cheerio@^1.0.0-rc.3:
lodash "^4.15.0"
parse5 "^3.0.1"
child_process@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/child_process/-/child_process-1.0.2.tgz#b1f7e7fc73d25e7fd1d455adc94e143830182b5a"
integrity sha1-sffn/HPSXn/R1FWtyU4UODAYK1o=
"chokidar@>=2.0.0 <4.0.0", chokidar@^3.0.2, chokidar@^3.4.0:
version "3.4.0"
resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz#b30611423ce376357c765b9b8f904b9fba3c0be8"