优化
This commit is contained in:
@@ -154,26 +154,12 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
upload (img) {
|
|
||||||
let formData = new FormData()
|
|
||||||
formData.append('file', img)
|
|
||||||
|
|
||||||
this.$loading()
|
|
||||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.richList.push({
|
this.richList.push({
|
||||||
type: 'img',
|
type: 'img',
|
||||||
value: res.data.url
|
value: v
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -163,26 +163,12 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
upload (img) {
|
|
||||||
let formData = new FormData()
|
|
||||||
formData.append('file', img)
|
|
||||||
|
|
||||||
this.$loading()
|
|
||||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.richList.push({
|
this.richList.push({
|
||||||
type: 'img',
|
type: 'img',
|
||||||
value: res.data.url
|
value: v
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -184,26 +184,12 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
upload (img) {
|
|
||||||
let formData = new FormData()
|
|
||||||
formData.append('file', img)
|
|
||||||
|
|
||||||
this.$loading()
|
|
||||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.richList.push({
|
this.richList.push({
|
||||||
type: 'img',
|
type: 'img',
|
||||||
value: res.data.url
|
value: v
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -154,26 +154,12 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
upload (img) {
|
|
||||||
let formData = new FormData()
|
|
||||||
formData.append('file', img)
|
|
||||||
|
|
||||||
this.$loading()
|
|
||||||
this.$http.post('/admin/file/add2?type=image', formData).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
this.richList.push({
|
this.richList.push({
|
||||||
type: 'img',
|
type: 'img',
|
||||||
value: res.data.url
|
value: v
|
||||||
|
})
|
||||||
})
|
})
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user