fix(api-gateway,admin-web): 修复仪表板API路由配置
Kong 网关: - 添加 /api/v1/dashboard 路由到 reporting-service Admin-Web 前端: - 修复所有 API endpoints 添加 /v1 前缀 - 确保与 Kong 路由配置一致 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
9452d14962
commit
917e3094a2
|
|
@ -161,10 +161,13 @@ services:
|
||||||
- name: reporting-service
|
- name: reporting-service
|
||||||
url: http://192.168.1.111:3008
|
url: http://192.168.1.111:3008
|
||||||
routes:
|
routes:
|
||||||
|
- name: reporting-dashboard
|
||||||
|
paths:
|
||||||
|
- /api/v1/dashboard
|
||||||
|
strip_path: false
|
||||||
- name: reporting-api
|
- name: reporting-api
|
||||||
paths:
|
paths:
|
||||||
- /api/v1/reports
|
- /api/v1/reports
|
||||||
- /api/v1/statistics
|
|
||||||
strip_path: false
|
strip_path: false
|
||||||
- name: reporting-export
|
- name: reporting-export
|
||||||
paths:
|
paths:
|
||||||
|
|
|
||||||
|
|
@ -1,90 +1,99 @@
|
||||||
// API 端点定义
|
// API 端点定义
|
||||||
|
// 注意: baseURL 是 https://api.rwadurian.com/api,Kong 路由前缀是 /api/v1/
|
||||||
|
// 所以这里的端点需要以 /v1/ 开头
|
||||||
|
|
||||||
export const API_ENDPOINTS = {
|
export const API_ENDPOINTS = {
|
||||||
// 认证
|
// 认证 (identity-service)
|
||||||
AUTH: {
|
AUTH: {
|
||||||
LOGIN: '/auth/login',
|
LOGIN: '/v1/auth/login',
|
||||||
LOGOUT: '/auth/logout',
|
LOGOUT: '/v1/auth/logout',
|
||||||
REFRESH: '/auth/refresh',
|
REFRESH: '/v1/auth/refresh',
|
||||||
FORGOT_PASSWORD: '/auth/forgot-password',
|
FORGOT_PASSWORD: '/v1/auth/forgot-password',
|
||||||
REGISTER: '/auth/register',
|
REGISTER: '/v1/auth/register',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 用户管理 (admin-service)
|
// 用户管理 (admin-service)
|
||||||
USERS: {
|
USERS: {
|
||||||
LIST: '/admin/users',
|
LIST: '/v1/admin/users',
|
||||||
DETAIL: (id: string) => `/admin/users/${id}`,
|
DETAIL: (id: string) => `/v1/admin/users/${id}`,
|
||||||
STATS: '/admin/users/stats/summary',
|
STATS: '/v1/admin/users/stats/summary',
|
||||||
UPDATE: (id: string) => `/admin/users/${id}`,
|
UPDATE: (id: string) => `/v1/admin/users/${id}`,
|
||||||
DELETE: (id: string) => `/admin/users/${id}`,
|
DELETE: (id: string) => `/v1/admin/users/${id}`,
|
||||||
EXPORT: '/admin/users/export',
|
EXPORT: '/v1/admin/users/export',
|
||||||
BATCH_UPDATE: '/admin/users/batch',
|
BATCH_UPDATE: '/v1/admin/users/batch',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 龙虎榜
|
// 龙虎榜 (leaderboard-service)
|
||||||
LEADERBOARD: {
|
LEADERBOARD: {
|
||||||
RANKINGS: '/leaderboard/rankings',
|
RANKINGS: '/v1/leaderboard/rankings',
|
||||||
DAILY: '/leaderboard/daily',
|
DAILY: '/v1/leaderboard/daily',
|
||||||
WEEKLY: '/leaderboard/weekly',
|
WEEKLY: '/v1/leaderboard/weekly',
|
||||||
MONTHLY: '/leaderboard/monthly',
|
MONTHLY: '/v1/leaderboard/monthly',
|
||||||
SETTINGS: '/leaderboard/settings',
|
SETTINGS: '/v1/leaderboard/settings',
|
||||||
EXPORT: '/leaderboard/export',
|
EXPORT: '/v1/leaderboard/export',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 授权管理
|
// 授权管理 (authorization-service)
|
||||||
AUTHORIZATION: {
|
AUTHORIZATION: {
|
||||||
PROVINCE_COMPANIES: '/authorization/province-companies',
|
PROVINCE_COMPANIES: '/v1/authorizations/province-companies',
|
||||||
CITY_COMPANIES: '/authorization/city-companies',
|
CITY_COMPANIES: '/v1/authorizations/city-companies',
|
||||||
PROVINCE_RULES: '/authorization/province-rules',
|
PROVINCE_RULES: '/v1/authorizations/province-rules',
|
||||||
CITY_RULES: '/authorization/city-rules',
|
CITY_RULES: '/v1/authorizations/city-rules',
|
||||||
ASSESSMENT_RULES: '/authorization/assessment-rules',
|
ASSESSMENT_RULES: '/v1/authorizations/assessment-rules',
|
||||||
LADDER_TARGETS: '/authorization/ladder-targets',
|
LADDER_TARGETS: '/v1/authorizations/ladder-targets',
|
||||||
LIMITS: '/authorization/limits',
|
LIMITS: '/v1/authorizations/limits',
|
||||||
AUTHORIZE: (id: string) => `/authorization/${id}/authorize`,
|
AUTHORIZE: (id: string) => `/v1/authorizations/${id}/authorize`,
|
||||||
REVOKE: (id: string) => `/authorization/${id}/revoke`,
|
REVOKE: (id: string) => `/v1/authorizations/${id}/revoke`,
|
||||||
},
|
},
|
||||||
|
|
||||||
// 数据统计
|
// 数据统计 (reporting-service)
|
||||||
STATISTICS: {
|
STATISTICS: {
|
||||||
OVERVIEW: '/statistics/overview',
|
OVERVIEW: '/v1/reports/overview',
|
||||||
TREND: '/statistics/trend',
|
TREND: '/v1/reports/trend',
|
||||||
REGION: '/statistics/region',
|
REGION: '/v1/reports/region',
|
||||||
REGION_PROVINCE: '/statistics/region/province',
|
REGION_PROVINCE: '/v1/reports/region/province',
|
||||||
REGION_CITY: '/statistics/region/city',
|
REGION_CITY: '/v1/reports/region/city',
|
||||||
LEADERBOARD: '/statistics/leaderboard',
|
LEADERBOARD: '/v1/reports/leaderboard',
|
||||||
OPERATIONS: '/statistics/operations',
|
OPERATIONS: '/v1/reports/operations',
|
||||||
REVENUE: '/statistics/revenue',
|
REVENUE: '/v1/reports/revenue',
|
||||||
EXPORT: '/statistics/export',
|
EXPORT: '/v1/export',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 系统设置
|
// 系统设置 (admin-service)
|
||||||
SETTINGS: {
|
SETTINGS: {
|
||||||
ALL: '/settings',
|
ALL: '/v1/admin/settings',
|
||||||
SETTLEMENT: '/settings/settlement',
|
SETTLEMENT: '/v1/admin/settings/settlement',
|
||||||
LEADERBOARD: '/settings/leaderboard',
|
LEADERBOARD: '/v1/admin/settings/leaderboard',
|
||||||
QUOTA: '/settings/quota',
|
QUOTA: '/v1/admin/settings/quota',
|
||||||
ASSESSMENT: '/settings/assessment',
|
ASSESSMENT: '/v1/admin/settings/assessment',
|
||||||
DISPLAY: '/settings/display',
|
DISPLAY: '/v1/admin/settings/display',
|
||||||
SECURITY: '/settings/security',
|
SECURITY: '/v1/admin/settings/security',
|
||||||
ACCOUNTS: '/settings/accounts',
|
ACCOUNTS: '/v1/admin/settings/accounts',
|
||||||
OPERATION_LOGS: '/settings/operation-logs',
|
OPERATION_LOGS: '/v1/admin/settings/operation-logs',
|
||||||
|
},
|
||||||
|
|
||||||
|
// 系统配置 (admin-service)
|
||||||
|
SYSTEM_CONFIG: {
|
||||||
|
ALL: '/v1/admin/system-config',
|
||||||
|
DISPLAY_SETTINGS: '/v1/admin/system-config/display/settings',
|
||||||
|
BY_KEY: (key: string) => `/v1/admin/system-config/${key}`,
|
||||||
},
|
},
|
||||||
|
|
||||||
// 帮助中心
|
// 帮助中心
|
||||||
HELP: {
|
HELP: {
|
||||||
DOCUMENTS: '/help/documents',
|
DOCUMENTS: '/v1/help/documents',
|
||||||
DOCUMENT_DETAIL: (id: string) => `/help/documents/${id}`,
|
DOCUMENT_DETAIL: (id: string) => `/v1/help/documents/${id}`,
|
||||||
FAQ: '/help/faq',
|
FAQ: '/v1/help/faq',
|
||||||
SEARCH: '/help/search',
|
SEARCH: '/v1/help/search',
|
||||||
FEEDBACK: '/help/feedback',
|
FEEDBACK: '/v1/help/feedback',
|
||||||
},
|
},
|
||||||
|
|
||||||
// 仪表板
|
// 仪表板 (reporting-service)
|
||||||
DASHBOARD: {
|
DASHBOARD: {
|
||||||
OVERVIEW: '/dashboard/overview',
|
OVERVIEW: '/v1/dashboard/overview',
|
||||||
STATS: '/dashboard/stats',
|
STATS: '/v1/dashboard/stats',
|
||||||
ACTIVITIES: '/dashboard/activities',
|
ACTIVITIES: '/v1/dashboard/activities',
|
||||||
CHARTS: '/dashboard/charts',
|
CHARTS: '/v1/dashboard/charts',
|
||||||
REGION: '/dashboard/region',
|
REGION: '/v1/dashboard/region',
|
||||||
},
|
},
|
||||||
} as const;
|
} as const;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue