|
|
@@ -318,11 +318,14 @@ describe('认证API集成测试 (使用hono/testing)', () => {
|
|
|
const regularToken = authService.generateToken(regularUser);
|
|
|
|
|
|
// 尝试访问需要认证的端点(这里使用/me端点)
|
|
|
- const response = await client.auth.me.$get({
|
|
|
- headers: {
|
|
|
- 'Authorization': `Bearer ${regularToken}`
|
|
|
+ const response = await client.auth.me.$get(
|
|
|
+ {},
|
|
|
+ {
|
|
|
+ headers: {
|
|
|
+ 'Authorization': `Bearer ${regularToken}`
|
|
|
+ }
|
|
|
}
|
|
|
- });
|
|
|
+ );
|
|
|
|
|
|
// 普通用户应该能够访问自己的信息
|
|
|
expect(response.status).toBe(200);
|