From 44edc1e712c4c76ca8e89b8ce91e0d06bb9b9fb4 Mon Sep 17 00:00:00 2001 From: Michael Bai Date: Thu, 28 Oct 2021 13:05:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=88=9B=E5=BB=BA?= =?UTF-8?q?=E4=BA=91=E6=9C=8D=E5=8A=A1=E8=B4=A6=E5=8F=B7json=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E6=96=87=E4=BB=B6=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/FormFields/UploadKey.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/FormFields/UploadKey.vue b/src/components/FormFields/UploadKey.vue index a90049dbd..bb99cac69 100644 --- a/src/components/FormFields/UploadKey.vue +++ b/src/components/FormFields/UploadKey.vue @@ -26,6 +26,10 @@ export default { if (e.target.files.length === 0) { return } + const file_name = e.target.files[0].name + if (file_name.substr(-5) !== '.json') { + return + } const vm = this const reader = new FileReader() reader.onload = function() {