Skip to content

Commit 0fe06d3

Browse files
committed
fix controller set body error
1 parent cc3cea9 commit 0fe06d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/controller/controller.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ class Controller extends EventEmitter {
2424
this._filters = {};
2525
Object.assign(this, ctx);
2626
this.ctx = ctx;
27+
Object.defineProperties(this, {
28+
body: {
29+
set(value) {
30+
ctx.body = value;
31+
},
32+
get() {
33+
return ctx.body;
34+
}
35+
}
36+
});
2737
}
2838
/**
2939
* register filter(s) for specific action, the filter(s) will run before action execute

0 commit comments

Comments
 (0)