优化可配置爬虫前端界面

This commit is contained in:
marvzhang
2019-11-28 21:36:17 +08:00
parent bc81462a80
commit ba4f5fd20c
11 changed files with 186 additions and 93 deletions

View File

@@ -43,12 +43,7 @@ const actions = {
commit('SET_FILE_CONTENT', response.data.data)
})
},
saveFileContent ({ state, rootState }, payload) {
const { path } = payload
const spiderId = rootState.spider.spiderForm._id
const content = state.fileContent
return request.post(`/spiders/${spiderId}/file`, { content, path })
}
}
export default {

View File

@@ -148,6 +148,13 @@ const actions = {
},
extractFields ({ state, commit }) {
return request.post(`/spiders/${state.spiderForm._id}/extract_fields`)
},
postConfigSpiderConfig ({ state }) {
return request.post(`/config_spiders/${state.spiderForm._id}/config`, state.spiderForm.config)
},
saveConfigSpiderSpiderfile ({ state, rootState }) {
const content = rootState.file.fileContent
return request.post(`/config_spiders/${state.spiderForm._id}/spiderfile`, { content })
}
}