@@ -10,22 +10,24 @@ function loadNested (path, qs, file, next, vm, first) {
1010
1111 if ( ! path ) return
1212
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 ) )
1618}
1719
1820export function fetchMixin ( proto ) {
1921 let last
2022 proto . _fetch = function ( cb = noop ) {
2123 const { path, query } = this . route
2224 const qs = stringifyQuery ( query , [ 'id' ] )
23- const { loadNavbar, loadSidebar } = this . config
25+ const { loadNavbar, loadSidebar, requestHeaders } = this . config
2426
2527 // Abort last request
2628 last && last . abort && last . abort ( )
2729
28- last = get ( this . router . getFile ( path ) + qs , true )
30+ last = get ( this . router . getFile ( path ) + qs , true , requestHeaders )
2931
3032 // Current page is html
3133 this . isHTML = / \. h t m l $ / g. test ( path )
@@ -67,7 +69,7 @@ export function fetchMixin (proto) {
6769 }
6870
6971 proto . _fetchCover = function ( ) {
70- const { coverpage } = this . config
72+ const { coverpage, requestHeaders } = this . config
7173 const query = this . route . query
7274 const root = getParentPath ( this . route . path )
7375
@@ -89,8 +91,8 @@ export function fetchMixin (proto) {
8991 if ( path ) {
9092 path = this . router . getFile ( root + path )
9193 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 )
9496 )
9597 } else {
9698 this . _renderCover ( )
0 commit comments