优化
This commit is contained in:
@@ -154,30 +154,16 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
this.richList.push({
|
||||||
|
type: 'img',
|
||||||
|
value: 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({
|
|
||||||
type: 'img',
|
|
||||||
value: res.data.url
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm () {
|
confirm () {
|
||||||
if (!this.content) {
|
if (!this.content) {
|
||||||
return this.$u.toast('文本不能为空')
|
return this.$u.toast('文本不能为空')
|
||||||
|
|||||||
@@ -163,30 +163,16 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
this.richList.push({
|
||||||
|
type: 'img',
|
||||||
|
value: 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({
|
|
||||||
type: 'img',
|
|
||||||
value: res.data.url
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm () {
|
confirm () {
|
||||||
if (!this.content) {
|
if (!this.content) {
|
||||||
return this.$u.toast('文本不能为空')
|
return this.$u.toast('文本不能为空')
|
||||||
|
|||||||
@@ -184,30 +184,16 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
this.richList.push({
|
||||||
|
type: 'img',
|
||||||
|
value: 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({
|
|
||||||
type: 'img',
|
|
||||||
value: res.data.url
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm () {
|
confirm () {
|
||||||
if (!this.content) {
|
if (!this.content) {
|
||||||
return this.$u.toast('文本不能为空')
|
return this.$u.toast('文本不能为空')
|
||||||
|
|||||||
@@ -154,30 +154,16 @@
|
|||||||
count: 9,
|
count: 9,
|
||||||
sizeType: ['compressed'],
|
sizeType: ['compressed'],
|
||||||
success: res => {
|
success: res => {
|
||||||
res.tempFiles.forEach(v => {
|
res.tempFilePaths.forEach(v => {
|
||||||
this.upload(v)
|
this.richList.push({
|
||||||
|
type: 'img',
|
||||||
|
value: 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({
|
|
||||||
type: 'img',
|
|
||||||
value: res.data.url
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
this.$u.toast(res.msg)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
confirm () {
|
confirm () {
|
||||||
if (!this.content) {
|
if (!this.content) {
|
||||||
return this.$u.toast('文本不能为空')
|
return this.$u.toast('文本不能为空')
|
||||||
|
|||||||
Reference in New Issue
Block a user