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
+7 -7
View File
@@ -5,7 +5,7 @@ test.describe('认证和授权测试', () => {
let userId: number;
test.beforeAll(async ({ request }) => {
const response = await request.post('http://localhost:8080/api/auth/login', {
const response = await request.post('http://localhost:8080/api/admin/auth/login', {
headers: {
'Content-Type': 'application/json'
},
@@ -28,7 +28,7 @@ test.describe('认证和授权测试', () => {
});
await test.step('发送登录请求', async () => {
const response = await page.request.post('http://localhost:8080/api/auth/login', {
const response = await page.request.post('http://localhost:8080/api/admin/auth/login', {
headers: {
'Content-Type': 'application/json'
},
@@ -78,7 +78,7 @@ test.describe('认证和授权测试', () => {
});
await test.step('查询指定用户信息', async () => {
const response = await page.request.get(`http://localhost:8080/api/users/${userId}`, {
const response = await page.request.get(`http://localhost:8080/api/admin/users/${userId}`, {
headers: {
'Authorization': `Bearer ${authToken}`
}
@@ -98,10 +98,10 @@ test.describe('认证和授权测试', () => {
test('权限验证测试', async ({ page }) => {
await test.step('测试访问受保护的API', async () => {
const protectedEndpoints = [
'/api/users',
'/api/roles',
'/api/menus',
'/api/config'
'/api/admin/users',
'/api/admin/roles',
'/api/admin/menus',
'/api/admin/config'
];
for (const endpoint of protectedEndpoints) {