feat: Web 管理后台及 e2e 测试适配 API 路径变更

- e2e-tests API 路径统一更新为 /api/admin/ 和 /api/member/ 前缀
- Gateway isPublicPath 更新为 /api/admin/auth/ 和 /api/member/auth/
- Gateway 签名白名单路径更新
- 移除已废弃的 /api/checkIn/ 和 /api/auth/login 公开路径
This commit is contained in:
张翔
2026-06-03 11:51:47 +08:00
parent 981d8ef211
commit 5237dfc1cb
11 changed files with 34 additions and 36 deletions
+6 -6
View File
@@ -269,7 +269,7 @@ async function verifyAllServices(): Promise<void> {
console.log(' 验证网关到后端的连通性...');
try {
const response = await fetch('http://localhost:8080/api/auth/login', {
const response = await fetch('http://localhost:8080/api/admin/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: 'admin', password: 'Test@123' }),
@@ -316,7 +316,7 @@ async function waitForBackendReady(): Promise<void> {
console.log(`✅ 后端服务健康检查通过 (尝试 ${i + 1}/${maxRetries})`);
try {
const loginTest = await fetch('http://localhost:8084/api/auth/login', {
const loginTest = await fetch('http://localhost:8084/api/admin/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: 'admin', password: 'Test@123' }),
@@ -364,7 +364,7 @@ async function waitForGatewayReady(): Promise<void> {
console.log(`✅ 网关服务健康检查通过 (尝试 ${i + 1}/${maxRetries})`);
try {
const loginTest = await fetch('http://localhost:8080/api/auth/login', {
const loginTest = await fetch('http://localhost:8080/api/admin/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: 'admin', password: 'Test@123' }),
@@ -425,7 +425,7 @@ async function waitForFrontendReady(): Promise<void> {
async function cleanupTestData(): Promise<void> {
try {
// 登录获取token(通过网关)
const loginResponse = await fetch('http://localhost:8080/api/auth/login', {
const loginResponse = await fetch('http://localhost:8080/api/admin/auth/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
@@ -458,7 +458,7 @@ async function cleanupTestData(): Promise<void> {
for (const user of users) {
if (user.id > 10) {
try {
await fetch(`http://localhost:8080/api/users/${user.id}`, {
await fetch(`http://localhost:8080/api/admin/users/${user.id}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${token}`
@@ -486,7 +486,7 @@ async function cleanupTestData(): Promise<void> {
for (const role of roles) {
if (role.id > 4) {
try {
await fetch(`http://localhost:8080/api/roles/${role.id}`, {
await fetch(`http://localhost:8080/api/admin/roles/${role.id}`, {
method: 'DELETE',
headers: {
'Authorization': `Bearer ${token}`