|
@@ -155,7 +155,6 @@
|
|
|
import { createFolderData, queryAllFolderData, queryCasesData, deleteFolderData, deleteCaseData, updateFolderData, caseUpdateFolderName, updateXmindUrl, uploadCaseByXmind } from '@/api/caseProject.js'
|
|
|
import { mockUrl } from '@/apiConfig/api'
|
|
|
// import fetch from "isomorphic-fetch"
|
|
|
-require('isomorphic-fetch')
|
|
|
// import FileSaver from 'file-saver'
|
|
|
import axios from 'axios'
|
|
|
// import XLSX from 'xlsx'
|
|
@@ -633,29 +632,22 @@ export default {
|
|
|
var formData_s = new FormData()
|
|
|
formData_s.append('file', f)
|
|
|
this.grid_xmind.push({ 'name': f.name, 'url': 'http://pt-starfile.didistatic.com/static/starfile/node/hjvKFStkqD1574316045070.xmind' })
|
|
|
- // url (必须), init对象 (可选)
|
|
|
- fetch('http://star.xiaojukeji.com/upload/img.node', formData_s, { credentials: 'include' }).then(function(res) {
|
|
|
- console.log(res)
|
|
|
- return res.json()
|
|
|
- }).catch(err => {
|
|
|
- console.log(err)
|
|
|
+ axios.post('http://star.xiaojukeji.com/upload/img.node', formData_s, { withCredentials: false, headers: { 'Content-Type': 'multipart/form-data' }}).then(res => {
|
|
|
+ console.log(res.url)
|
|
|
+ if (res.url) {
|
|
|
+ this.grid_xmind.push({ 'name': f.name, 'url': 'http:' + res.url })
|
|
|
+ var xmind_code = {
|
|
|
+ id: this.startId,
|
|
|
+ xmindUrl: JSON.stringify(this.grid_xmind),
|
|
|
+ modifier: this.userInformation
|
|
|
+ }
|
|
|
+ updateXmindUrl(xmind_code).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({ type: 'success', message: '导入成功' })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
})
|
|
|
- // axios.post('http://star.xiaojukeji.com/upload/img.node', formData_s, { withCredentials: true, headers: { 'Content-Type': 'multipart/form-data' }}).then(res => {
|
|
|
- // console.log(res.url)
|
|
|
- // if (res.url) {
|
|
|
- // this.grid_xmind.push({ 'name': f.name, 'url': 'http:' + res.url })
|
|
|
- // var xmind_code = {
|
|
|
- // id: this.startId,
|
|
|
- // xmindUrl: JSON.stringify(this.grid_xmind),
|
|
|
- // modifier: this.userInformation
|
|
|
- // }
|
|
|
- // updateXmindUrl(xmind_code).then(res => {
|
|
|
- // if (res.code === 200) {
|
|
|
- // this.$message({ type: 'success', message: '导入成功' })
|
|
|
- // }
|
|
|
- // })
|
|
|
- // }
|
|
|
- // })
|
|
|
} else {
|
|
|
this.$message({ type: 'error', message: '导入失败,不支持文件类型(只支持xmind)' })
|
|
|
}
|