瀏覽代碼

Pass configuration interceptors to spec download fetch

bubble
Kyle Shockey 7 年之前
父節點
當前提交
74165f5292
共有 1 個檔案被更改,包括 4 行新增1 行删除
  1. +4
    -1
      src/core/plugins/download-url.js

+ 4
- 1
src/core/plugins/download-url.js 查看文件

@@ -7,13 +7,16 @@ export default function downloadUrlPlugin (toolbox) {
let { fn } = toolbox

const actions = {
download: (url)=> ({ errActions, specSelectors, specActions }) => {
download: (url)=> ({ errActions, specSelectors, specActions, getConfigs }) => {
let { fetch } = fn
const config = getConfigs()
url = url || specSelectors.url()
specActions.updateLoadingStatus("loading")
fetch({
url,
loadSpec: true,
requestInterceptor: config.requestInterceptor || (a => a),
responseInterceptor: config.responseInterceptor || (a => a),
credentials: "same-origin",
headers: {
"Accept": "application/json,*/*"


Loading…
取消
儲存