li.shaoyi 1 éve
szülő
commit
d4e9e9ec52
3 módosított fájl, 10 hozzáadás és 36 törlés
  1. 1 1
      public/config/appconfig.json
  2. 5 20
      script/build.js
  3. 4 15
      script/dev.js

+ 1 - 1
public/config/appconfig.json

@@ -12,6 +12,6 @@
     "holdvolume"
   ],
   "forcedPasswordChange": true,
-  "appName": "多元世纪",
+  "appName": "多元世纪交易中心",
   "tradeChannel": "ws"
 }

+ 5 - 20
script/build.js

@@ -4,26 +4,11 @@ const { spawn } = require('child_process')
 const argv = process.argv
 const env = oemEnv.find((e) => argv.includes(e.VUE_APP_ENV))
 
-if (env) {
-    const command = process.platform === 'win32' ? 'npx.cmd' : 'npx'
-    // 创建子进程  
-    const build = spawn(command, ['vue-cli-service', 'build'], { env })
-
-    // 监听子进程的输出  
-    build.stdout.on('data', (data) => {
-        console.log(data.toString())
-    })
-
-    build.stderr.on('data', (data) => {
-        console.error(`stderr: ${data}`)
-    })
-
-    build.on('close', (code) => {
-        console.log(`子进程退出,退出码 ${code}`)
-    })
-
-    build.on('error', (code) => {
-        console.log(`编译失败 ${code}`)
+if (env) { 
+    spawn('npx', ['vue-cli-service', 'build'], {
+        env,
+        stdio: 'inherit',
+        shell: process.platform === 'win32'
     })
 } else {
     console.error('环境变量不存在')

+ 4 - 15
script/dev.js

@@ -5,21 +5,10 @@ const argv = process.argv
 const env = oemEnv.find((e) => argv.includes(e.VUE_APP_ENV))
 
 if (env) {
-    const command = process.platform === 'win32' ? 'npx.cmd' : 'npx'
-    // 创建子进程  
-    const build = spawn(command, ['vue-cli-service', 'serve'], { env })
-
-    // 监听子进程的输出  
-    build.stdout.on('data', (data) => {
-        console.log(data.toString())
-    })
-
-    build.stderr.on('data', (data) => {
-        console.error(`stderr: ${data}`)
-    })
-
-    build.on('error', (code) => {
-        console.log(`运行失败 ${code}`)
+    spawn('npx', ['vue-cli-service', 'serve'], {
+        env,
+        stdio: 'inherit',
+        shell: process.platform === 'win32'
     })
 } else {
     console.error('环境变量不存在')