feat(3c): DT 단말 + 콘솔 센터(DC1/DC2/DC3) 전환

- DT 단말(:5180, dt.html/src/dt): 접속 센터 선택 후 해당 Gucci 관문으로 로그인·이체·조회.
  vite.dt.config 프록시 /dc1|/dc2|/dc3 -> 8095|8195|8295. X-Timestamp 초 단위(ReplayGuard).
- 콘솔 센터 전환: auth.ts getDc/setDc + X-RTGS-DC 헤더, App.tsx 드롭다운(+reload),
  vite.config router로 헤더 기반 포트 라우팅(+0/+100/+200) → 3센터 원장·대사·보고서 전환 조회.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
rtgs
2026-07-16 17:33:43 +09:00
parent d180d516cd
commit 427f361783
8 changed files with 269 additions and 26 deletions

View File

@@ -1,22 +1,31 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// RTGS 조회 콘솔 (:5174). Chanel(:8091)로 프록시하여 CORS 회피.
// RTGS 조회/관리 콘솔 (:5174). 요청 헤더 X-RTGS-DC(DC1/DC2/DC3)로 대상 센터 포트를 라우팅한다.
// Chanel계열 8091 / LouisVuitton(admin) 8099 / Gucci 8095, 센터별 +100/+200 오프셋.
const OFFSET: Record<string, number> = { DC1: 0, DC2: 100, DC3: 200 }
const off = (req: any) => OFFSET[(req.headers?.['x-rtgs-dc'] as string) || 'DC1'] ?? 0
const routed = (basePort: number) => ({
target: `http://localhost:${basePort}`,
changeOrigin: true,
router: (req: any) => `http://localhost:${basePort + off(req)}`,
})
export default defineConfig({
plugins: [react()],
server: {
port: 5174,
proxy: {
'/accounts': { target: 'http://localhost:8091', changeOrigin: true },
'/inquiry': { target: 'http://localhost:8091', changeOrigin: true },
'/pay': { target: 'http://localhost:8091', changeOrigin: true },
'/meta': { target: 'http://localhost:8091', changeOrigin: true },
'/rawmessage': { target: 'http://localhost:8091', changeOrigin: true },
'/notifications': { target: 'http://localhost:8091', changeOrigin: true },
'/ledger': { target: 'http://localhost:8091', changeOrigin: true },
'/admin': { target: 'http://localhost:8099', changeOrigin: true },
'/console': { target: 'http://localhost:8099', changeOrigin: true },
'/gucci': { target: 'http://localhost:8095', changeOrigin: true },
'/accounts': routed(8091),
'/inquiry': routed(8091),
'/pay': routed(8091),
'/meta': routed(8091),
'/rawmessage': routed(8091),
'/notifications': routed(8091),
'/ledger': routed(8091),
'/admin': routed(8099),
'/console': routed(8099),
'/gucci': routed(8095),
},
},
})