[update] 上传文件的限制文件名长度截取修改

This commit is contained in:
lideqin
2024-09-25 09:31:55 +08:00
parent be9576a4eb
commit 91b9028c30
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -345,7 +345,7 @@ export default {
doBeforeUpload (file) {
this.uploadGoOn = true
file.uploadGoOn = true
if (file.name.split('.')[0].length > 30) {
if (file.name.substring(0, file.name.lastIndexOf('.')).length > 30) {
this.$message.warning(this.$t('uploadFile.fileNameOverlong'))
this.uploadGoOn = false
file.uploadGoOn = false
+1 -1
View File
@@ -313,7 +313,7 @@ export default {
console.log('--------file', file)
this.uploadGoOn = true
file.uploadGoOn = true
if (file.name.split('.')[0].length > 30) {
if (file.name.substring(0, file.name.lastIndexOf('.')).length > 30) {
this.$message.warning(this.$t('uploadFile.fileNameOverlong'))
this.uploadGoOn = false
file.uploadGoOn = false