|
@@ -1214,7 +1214,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
async confirmUpload() {
|
|
|
- if (this.imageName === null) {
|
|
|
+ if (this.imageName === null || this.imageName.replace(/\s+/g, '') === '') {
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: '请输入图片名称',
|
|
@@ -1222,6 +1222,17 @@ export default {
|
|
|
})
|
|
|
return false
|
|
|
}
|
|
|
+ const isExist = this.fileList.every(item => {
|
|
|
+ return this.imageName === item.name
|
|
|
+ })
|
|
|
+ if (isExist) {
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '图片名称重复',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ return false
|
|
|
+ }
|
|
|
this.showCopyFile = false
|
|
|
const res = await this.updateFile(window.uploadFiles[0])
|
|
|
const data = res.data
|