feat(fetch): add requestHeaders option, fixed #336

This commit is contained in:
qingwei.li 2018-02-10 17:31:26 +08:00 committed by cinwell.li
commit 54ab4c9ff7
3 changed files with 20 additions and 13 deletions

View file

@ -165,9 +165,11 @@ export function init (config, vm) {
paths.forEach(path => {
if (INDEXS[path]) return count++
helper.get(vm.router.getFile(path)).then(result => {
INDEXS[path] = genIndex(path, result, vm.router, config.depth)
len === ++count && saveData(config.maxAge)
})
helper
.get(vm.router.getFile(path), false, vm.config.requestHeaders)
.then(result => {
INDEXS[path] = genIndex(path, result, vm.router, config.depth)
len === ++count && saveData(config.maxAge)
})
})
}