Skip to content

Commit

Permalink
fix: 导入导出数据格式错误修改
Browse files Browse the repository at this point in the history
  • Loading branch information
klren0312 committed Nov 12, 2019
1 parent 4fde57a commit 59aaf2d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/renderer/views/homePage/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ export default {
}
})
if (path) {
fs.writeFile(`${path}`, details.ruleConfig, () => {
fs.writeFile(`${path}`, JSON.stringify({
ruleConfig: details.ruleConfig,
type: app.type
}), () => {
remote.dialog.showMessageBox({
type: 'info',
title: '导出结果',
Expand Down Expand Up @@ -175,10 +178,12 @@ export default {
/* eslint-disable */
fs.readFile(filePath[0], 'utf8', (e, res) => {
if (e) throw e
const data = JSON.parse(res)
appCollection
.insert({
appName: filePath[0].match(/([^\.\/\\]+)\.([a-z]+)$/i)[1],
ruleConfig: res
ruleConfig: data.ruleConfig,
type: data.type
})
.write()
this.getAppList()
Expand Down

0 comments on commit 59aaf2d

Please sign in to comment.