fix: fix request not displaying interface error messages correctly (#4596)

This commit is contained in:
Vben
2024-10-09 22:08:55 +08:00
committed by GitHub
parent 8fe87b10dc
commit ba4662522e
9 changed files with 39 additions and 16 deletions

View File

@@ -41,12 +41,12 @@ export function useResponseError(message: string, error: any = null) {
export function forbiddenResponse(event: H3Event<EventHandlerRequest>) {
setResponseStatus(event, 403);
return useResponseError('ForbiddenException', 'Forbidden Exception');
return useResponseError('Forbidden Exception', 'Forbidden Exception');
}
export function unAuthorizedResponse(event: H3Event<EventHandlerRequest>) {
setResponseStatus(event, 401);
return useResponseError('UnauthorizedException', 'Unauthorized Exception');
return useResponseError('Unauthorized Exception', 'Unauthorized Exception');
}
export function sleep(ms: number) {