@@ -10,22 +10,24 @@ function loadNested (path, qs, file, next, vm, first) {
10
10
11
11
if ( ! path ) return
12
12
13
- get ( vm . router . getFile ( path + file ) + qs ) . then ( next , _ =>
14
- loadNested ( path , qs , file , next , vm )
15
- )
13
+ get (
14
+ vm . router . getFile ( path + file ) + qs ,
15
+ false ,
16
+ vm . config . requestHeaders
17
+ ) . then ( next , _ => loadNested ( path , qs , file , next , vm ) )
16
18
}
17
19
18
20
export function fetchMixin ( proto ) {
19
21
let last
20
22
proto . _fetch = function ( cb = noop ) {
21
23
const { path, query } = this . route
22
24
const qs = stringifyQuery ( query , [ 'id' ] )
23
- const { loadNavbar, loadSidebar } = this . config
25
+ const { loadNavbar, loadSidebar, requestHeaders } = this . config
24
26
25
27
// Abort last request
26
28
last && last . abort && last . abort ( )
27
29
28
- last = get ( this . router . getFile ( path ) + qs , true )
30
+ last = get ( this . router . getFile ( path ) + qs , true , requestHeaders )
29
31
30
32
// Current page is html
31
33
this . isHTML = / \. h t m l $ / g. test ( path )
@@ -67,7 +69,7 @@ export function fetchMixin (proto) {
67
69
}
68
70
69
71
proto . _fetchCover = function ( ) {
70
- const { coverpage } = this . config
72
+ const { coverpage, requestHeaders } = this . config
71
73
const query = this . route . query
72
74
const root = getParentPath ( this . route . path )
73
75
@@ -89,8 +91,8 @@ export function fetchMixin (proto) {
89
91
if ( path ) {
90
92
path = this . router . getFile ( root + path )
91
93
this . coverIsHTML = / \. h t m l $ / g. test ( path )
92
- get ( path + stringifyQuery ( query , [ 'id' ] ) ) . then ( text =>
93
- this . _renderCover ( text )
94
+ get ( path + stringifyQuery ( query , [ 'id' ] ) , false , requestHeaders ) . then (
95
+ text => this . _renderCover ( text )
94
96
)
95
97
} else {
96
98
this . _renderCover ( )
0 commit comments