Skip to content

Commit

Permalink
fix: request method
Browse files Browse the repository at this point in the history
  • Loading branch information
aooiuu committed Jul 15, 2024
1 parent 0fb3bfe commit 433bcae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/shared/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ async function runApp(app: App, register: any) {
for (const Controller of app.controllers) {
const routes = mapRoute(Controller)
for (const route of routes) {
register([route.method, route.route].join('@'), async (...arg: any) => {
register([route.method.toLowerCase(), route.route].join('@'), async (...arg: any) => {
const instance: any = new Controller(app)
return await instance[route.methodName](...arg)
.then((res: any) => success(res))
Expand Down
2 changes: 1 addition & 1 deletion packages/web/src/utils/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import axios from './axios';

export async function request(config: any) {
console.log('[request]', config);
const method = config.method ?? 'get';
const method = config.method?.toLowerCase() ?? 'get';
if (PLATFORM === 'browser') {
// web
return await axios(config);
Expand Down

0 comments on commit 433bcae

Please sign in to comment.