Skip to content

Commit

Permalink
Add all method support
Browse files Browse the repository at this point in the history
  • Loading branch information
adaex committed Sep 18, 2021
1 parent 3b0ee68 commit 8538565
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/service/CoaRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import * as querystring from 'querystring'
export interface CoaRouterOptions {
name?: string
desc?: string
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'
method?: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'ALL'
param?: { [i: string]: any }
result?: { [i: string]: any }
delete?: boolean
Expand Down Expand Up @@ -112,7 +112,7 @@ export class CoaRouter<T> {
}

layer || CoaError.throw('Gateway.NotFound', '网关接口不存在')
layer.method === method || CoaError.throw('Gateway.MethodNotAllowed', '当前网关接口请求方式不被允许')
layer.method === 'ALL' || layer.method === method || CoaError.throw('Gateway.MethodNotAllowed', '当前网关接口请求方式不被允许')
const handler = layer.handler || CoaError.throw('Gateway.HandlerNotFound', '当前网关接口处理方法不存在')
const group = layer.group

Expand Down

0 comments on commit 8538565

Please sign in to comment.