Browse Source

修复控制台乱码

master
hejl 1 week ago
parent
commit
1cd830268a
  1. 3
      .gitignore
  2. 10
      gofaster/app/dev-enhanced.ps1
  3. 8
      gofaster/dev-full.ps1
  4. 2
      gofaster/start.ps1

3
.gitignore vendored

@ -13,4 +13,5 @@ @@ -13,4 +13,5 @@
/gofaster/app/dist
/gofaster/backend/logs
/gofaster/tmp/
/gofaster/app/dist/*/*/
/gofaster/app/dist/*/*/
/gofaster/backend/tmp

10
gofaster/app/dev-enhanced.ps1

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# 增强版开发脚本 - 解决中文编码和日志问题
# 增强版开发脚本 - 解决中文编码和日志问题
param(
[switch]$Debug,
[switch]$Watch
@ -18,6 +18,14 @@ $env:LANG = "zh_CN.UTF-8" @@ -18,6 +18,14 @@ $env:LANG = "zh_CN.UTF-8"
$env:LC_ALL = "zh_CN.UTF-8"
$env:NODE_OPTIONS = "--max-old-space-size=4096"
# 设置Electron相关环境变量,改善DevTools兼容性
$env:ELECTRON_DISABLE_SECURITY_WARNINGS = "true"
$env:ELECTRON_ENABLE_LOGGING = "false"
$env:ELECTRON_ENABLE_STACK_DUMPING = "false"
$env:ELECTRON_NO_ASAR = "1"
$env:ELECTRON_RUN_AS_NODE = "false"
$env:ELECTRON_NO_ATTACH_CONSOLE = "true"
# 显示启动信息
Write-Host "🚀 启动 GoFaster 前端开发环境..." -ForegroundColor Cyan
Write-Host "📝 编码设置: UTF-8" -ForegroundColor Green

8
gofaster/dev-full.ps1

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# GoFaster Full Stack Development Environment
# GoFaster Full Stack Development Environment
param(
[switch]$Debug,
[switch]$Watch,
@ -7,15 +7,15 @@ param( @@ -7,15 +7,15 @@ param(
)
# Set console encoding
[Console]::OutputEncoding = [System.Text.Encoding]::UTF-8
$OutputEncoding = [System.Text.Encoding]::UTF-8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
$OutputEncoding = [System.Text.Encoding]::UTF8
# Set environment variables
$env:VUE_CLI_BABEL_TRANSPILE_MODULES = "false"
$env:VUE_CLI_MODERN_BUILD = "false"
$env:VUE_CLI_LOG_LEVEL = "info"
$env:VUE_CLI_DEBUG = "true"
$env:LANG = "zh_CN.UTF-8"
$env:LANG = "zh_CN.UTF-8"
$env:LC_ALL = "zh_CN.UTF-8"
$env:NODE_OPTIONS = "--max-old-space-size=4096"

2
gofaster/start.ps1

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
# GoFaster 开发环境启动脚本
# GoFaster 开发环境启动脚本
# 设置控制台编码为 UTF-8,解决中文显示乱码问题
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
[Console]::InputEncoding = [System.Text.Encoding]::UTF8

Loading…
Cancel
Save