调整在线编辑文件

This commit is contained in:
marvzhang
2020-01-15 20:10:51 +08:00
parent 172dfe6c7e
commit bd7c9cc05d
4 changed files with 91 additions and 106 deletions

View File

@@ -38,7 +38,8 @@ const actions = {
},
getFileContent ({ commit, rootState }, payload) {
const { path } = payload
return request.get(`/file`, { path })
const spiderId = rootState.spider.spiderForm._id
return request.get(`/spiders/${spiderId}/file`, { path })
.then(response => {
commit('SET_FILE_CONTENT', response.data.data)
})

View File

@@ -193,7 +193,7 @@ const actions = {
commit('schedule/SET_SCHEDULE_LIST', res.data.data, { root: true })
},
async getFileTree ({ state, commit }, payload) {
const { id } = payload
const id = payload ? payload.id : state.spiderForm._id
const res = await request.get(`/spiders/${id}/file/tree`)
commit('SET_FILE_TREE', res.data.data)
}