当用nestjs开发后端,用swagger写api时,直接在接口上添加
ApiHeader({
name : 'authorization',
description:'请输入token'
})
发送的请求是不会把authorization的值传过去的,因为authorization是有默认方法的,

可以在addBearerAuth()里面添加
{ type: 'http', scheme: 'bearer', bearerFormat: 'JWT' },
'access-token')
然后需要权限的接口上增加@ApiBearerAuth('access-token')
这样,在/api/admin里的Authorize里键入token,
就可以访问这些需要权限的接口了。