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

This commit is contained in:
qingwei.li
2018-02-11 22:22:06 +08:00
committed by cinwell.li
parent f960c196bf
commit 54ab4c9ff7
3 changed files with 20 additions and 13 deletions
+6 -4
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)
})
})
}