Skip to content

Commit

Permalink
fix(post): get password from cookie instead of body
Browse files Browse the repository at this point in the history
  • Loading branch information
wibus-wee committed Jul 18, 2022
1 parent 2a00d3d commit 4b401f8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/common/decorator/cookie.decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ export const Cookies = createParamDecorator(
cookieObj[key] = value;
}
);
return cookieObj;
return data ? cookieObj[data] : cookieObj;
},
);
2 changes: 1 addition & 1 deletion src/modules/post/post.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ export class PostController {

@Get("/:category/:slug")
@ApiOperation({ summary: "根据分类名与自定义别名获取文章详情" })
async getByCategoryAndSlug(@Param() params: CategoryAndSlugDto, @IsMaster() isMaster: boolean, @Cookies() password: any) {
async getByCategoryAndSlug(@Param() params: CategoryAndSlugDto, @IsMaster() isMaster: boolean, @Cookies("password") password: any) {
const { category, slug } = params;
const categoryDocument = await this.postService.getCategoryBySlug(category);
console.log(password);
Expand Down

0 comments on commit 4b401f8

Please sign in to comment.