File tree Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Expand file tree Collapse file tree 4 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 14
14
"@midwayjs/mock" : " ^3.20.4"
15
15
},
16
16
"dependencies" : {
17
- "@midwayjs/cookies" : " ^1.0.2 "
17
+ "@midwayjs/cookies" : " ^1.3.0 "
18
18
},
19
19
"keywords" : [
20
20
" midway" ,
Original file line number Diff line number Diff line change 30
30
},
31
31
"dependencies" : {
32
32
"@koa/router" : " ^12.0.0" ,
33
- "@midwayjs/cookies" : " ^1.0.2 " ,
33
+ "@midwayjs/cookies" : " ^1.3.0 " ,
34
34
"@midwayjs/core" : " ^3.20.4" ,
35
35
"@midwayjs/session" : " ^3.20.4" ,
36
36
"@types/koa" : " 2.15.0" ,
Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ export const cookies = {
42
42
// httpOnly: true | false,
43
43
// sameSite: 'none|lax|strict',
44
44
} ;
45
+ /**
46
+ * default cookie get options
47
+ */
48
+ export const cookiesGet = {
49
+ // sign: false,
50
+ } ;
45
51
46
52
export const onerror = { } ;
47
53
Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ export class MidwayKoaFramework extends BaseFramework<
72
72
}
73
73
74
74
const cookieOptions = this . configService . getConfiguration ( 'cookies' ) ;
75
+ const cookieGetOptions = this . configService . getConfiguration ( 'cookiesGet' ) ;
75
76
76
77
this . app = new koa < DefaultState , IMidwayKoaContext > ( {
77
78
keys : [ ] . concat ( appKeys ) ,
@@ -84,7 +85,12 @@ export class MidwayKoaFramework extends BaseFramework<
84
85
Object . defineProperty ( this . app . context , 'cookies' , {
85
86
get ( ) {
86
87
if ( ! this [ COOKIES ] ) {
87
- this [ COOKIES ] = new Cookies ( this , this . app . keys , cookieOptions ) ;
88
+ this [ COOKIES ] = new Cookies (
89
+ this ,
90
+ this . app . keys ,
91
+ cookieOptions ,
92
+ cookieGetOptions
93
+ ) ;
88
94
}
89
95
return this [ COOKIES ] ;
90
96
} ,
You can’t perform that action at this time.
0 commit comments