From b2f44877a5e4afce611f97e967104ecf3590514f Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 18 Feb 2021 10:01:31 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E8=BF=9B=EF=BC=9A=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E7=BB=84=E4=BB=B6=EF=BC=8C=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E7=9A=84url=E8=8E=B7=E5=8F=96=E7=9A=84?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/input/UploadImageInput.vue | 10 ++++++++-- src/views/setting/sys/logList.vue | 22 +++++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/components/input/UploadImageInput.vue b/src/components/input/UploadImageInput.vue index 6ff7de1..7b97caa 100644 --- a/src/components/input/UploadImageInput.vue +++ b/src/components/input/UploadImageInput.vue @@ -103,7 +103,7 @@ export default { fileList: [], isLocked: false, // true表示输入框正在输入状态 timer: null, - uploadState: 0, // 文件上传状态, 0 没有文件上传, 1 正在上传, 2 上传成功 + uploadState: 0, // 文件上传状态, 0 没有文件上传, 1 正在上传, 2 上传成功, 3 不支持自动上传, 4 加载中 uploadTip: '', dialogSelectFile: false, uploadPercentage: 0 @@ -187,11 +187,17 @@ export default { that.uploadState = 4 that.urlToBlob(that.currentValue, response => { that.uploadState = 1 + let fileName = that.getFileNameByUrl(that.currentValue) + if (response.type.startsWith("image") && fileName.indexOf(".")) { + let suffix = response.type.replace("image/",".") + fileName += suffix + } const file = new window.File( [response], - that.getFileNameByUrl(that.currentValue), + fileName, { type: response.type } ); + console.log(file) let data = new FormData() data.append("files", file) data.append("username", that.$store.state.user.name) diff --git a/src/views/setting/sys/logList.vue b/src/views/setting/sys/logList.vue index 0b16330..38f8f8e 100644 --- a/src/views/setting/sys/logList.vue +++ b/src/views/setting/sys/logList.vue @@ -6,9 +6,9 @@ - + - + - + - + + + + + + - +
查询 @@ -93,10 +98,7 @@ export default { pageSize: 12, pageTotal: 0 }, - options: this.type === 'LOGIN' ? [{ - value: 'LOGIN', - label: '登录' - }] : [{ + options: [{ value: 'LOGIN', label: '登录' }, { @@ -110,9 +112,11 @@ export default { label: 'WebDAV' }], typeValue: this.type, + isLoginType: this.type === 'LOGIN', // 查询条件 queryCondition: { username: undefined, + operationModule: undefined, type: this.type, startTime: undefined, endTime: undefined