fix: 更新token

This commit is contained in:
Daniel
2026-03-02 16:36:49 +08:00
parent a9caf6e7c0
commit ad73305ed1
11 changed files with 139 additions and 50 deletions

View File

@@ -3,6 +3,7 @@ import { Play, Pause, SkipBack, SkipForward, History } from 'lucide-react'
import { usePlaybackStore, REPLAY_TICKS, REPLAY_START, REPLAY_END } from '@/store/playbackStore'
import { useSituationStore } from '@/store/situationStore'
import { NewsTicker } from './NewsTicker'
import { config } from '@/config'
function formatTick(iso: string): string {
const d = new Date(iso)
@@ -78,7 +79,7 @@ export function TimelinePanel() {
</button>
{!isReplayMode && (
{!isReplayMode && config.showNewsTicker && (
<div className="min-w-0 flex-1">
<NewsTicker
updates={situation.recentUpdates}

View File

@@ -4,6 +4,7 @@ import type { MapRef } from 'react-map-gl'
import type { Map as MapboxMap } from 'mapbox-gl'
import 'mapbox-gl/dist/mapbox-gl.css'
import { useReplaySituation } from '@/hooks/useReplaySituation'
import { config } from '@/config'
import {
ATTACKED_TARGETS,
ALLIED_STRIKE_LOCATIONS,
@@ -15,7 +16,7 @@ import {
ISRAEL_STRIKE_TARGETS,
} from '@/data/mapLocations'
const MAPBOX_TOKEN = import.meta.env.VITE_MAPBOX_ACCESS_TOKEN || ''
const MAPBOX_TOKEN = config.mapboxAccessToken || ''
// 相关区域 bbox伊朗、以色列、胡塞区 (minLng, minLat, maxLng, maxLat),覆盖红蓝区域
const THEATER_BBOX = [22, 11, 64, 41] as const

10
src/config.ts Normal file
View File

@@ -0,0 +1,10 @@
/**
* 应用配置(不依赖 .env
*/
export const config = {
/** Mapbox 地图令牌 */
mapboxAccessToken:
'pk.eyJ1IjoiZDI5cTAiLCJhIjoiY21oaGRmcTkzMGltZzJscHR1N2FhZnY5dCJ9.7ueF2lS6-C9Mm_xon7NnIA',
/** 是否显示滚动情报 */
showNewsTicker: false,
}