Download apps/backend-mock/api/menu/all.ts from binhugg3/admin: direct link, hf CLI and curl.
- Browser
- Download file 406 Bytes
-
https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/backend-mock/api/menu/all.ts
- Command line
-
hf download hf://spaces/binhugg3/admin/apps/backend-mock/api/menu/all.ts
-
curl -L -o all.ts https://huggingface.co/spaces/binhugg3/admin/resolve/main/apps/backend-mock/api/menu/all.ts
406 Bytes
| import { verifyAccessToken } from '~/utils/jwt-utils'; | |
| import { unAuthorizedResponse } from '~/utils/response'; | |
| export default eventHandler(async (event) => { | |
| const userinfo = verifyAccessToken(event); | |
| if (!userinfo) { | |
| return unAuthorizedResponse(event); | |
| } | |
| const menus = | |
| MOCK_MENUS.find((item) => item.username === userinfo.username)?.menus ?? []; | |
| return useResponseSuccess(menus); | |
| }); | |