fix: 修复空 catch 吞异常问题,端口号抽离到配置,统一日志为 Serilog
- 所有空 catch 块补全日志记录,统一使用 Serilog/AppLog - 按场景分级:Error(意外失败)、Warning(次要问题)、Information(预期内) - 端口 HttpPort/HttpsPort 抽离到 appsettings.json Server 配置节 - QrCodeService 通过 IConfiguration 读取端口,消除硬编码 - 前端通过 Vite proxy 转发 /api,http.ts 统一使用 origin 地址 - 移除所有 Debug.WriteLine 和 Serilog.Log.Debug 日志 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -4,11 +4,8 @@ import { isWebView2 } from './env'
|
||||
// WebView2 自定义协议前缀
|
||||
const WEBVIEW2_BASE = 'app://api/'
|
||||
|
||||
// Vite 开发页走 5206 API;API 托管前端时使用同源地址。
|
||||
const isViteDevServer = window.location.port === '51552'
|
||||
const HTTP_ORIGIN = isViteDevServer
|
||||
? `${window.location.protocol}//${window.location.hostname || 'localhost'}:5206`
|
||||
: window.location.origin
|
||||
// Vite 开发时通过 proxy 转发 /api 到后端;API 托管前端时使用同源地址。
|
||||
const HTTP_ORIGIN = window.location.origin
|
||||
const HTTP_BASE = `${HTTP_ORIGIN}/api/`
|
||||
|
||||
export const apiOrigin = (): string => HTTP_ORIGIN
|
||||
|
||||
Reference in New Issue
Block a user