This commit is contained in:
yanran200730
2022-06-02 14:49:05 +08:00
parent cac2023ed4
commit 75832e6b0a
4 changed files with 20 additions and 76 deletions

View File

@@ -154,30 +154,16 @@
count: 9,
sizeType: ['compressed'],
success: res => {
res.tempFiles.forEach(v => {
this.upload(v)
res.tempFilePaths.forEach(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 () {
if (!this.content) {
return this.$u.toast('文本不能为空')

View File

@@ -163,30 +163,16 @@
count: 9,
sizeType: ['compressed'],
success: res => {
res.tempFiles.forEach(v => {
this.upload(v)
res.tempFilePaths.forEach(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 () {
if (!this.content) {
return this.$u.toast('文本不能为空')

View File

@@ -184,30 +184,16 @@
count: 9,
sizeType: ['compressed'],
success: res => {
res.tempFiles.forEach(v => {
this.upload(v)
res.tempFilePaths.forEach(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 () {
if (!this.content) {
return this.$u.toast('文本不能为空')

View File

@@ -154,30 +154,16 @@
count: 9,
sizeType: ['compressed'],
success: res => {
res.tempFiles.forEach(v => {
this.upload(v)
res.tempFilePaths.forEach(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 () {
if (!this.content) {
return this.$u.toast('文本不能为空')