From 0cbd50eeda06ce80b48917e542778189bd748402 Mon Sep 17 00:00:00 2001 From: yi-ge Date: Fri, 10 Jul 2020 14:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=8A=E4=BC=A0=E8=83=BD?= =?UTF-8?q?=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 + pages/post/_id.vue | 11 +++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 3bcd964..6a5c941 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "eslintignore", "fontawesome", "fortawesome", + "gotop", "hljs", "navication", "nuxt", diff --git a/pages/post/_id.vue b/pages/post/_id.vue index 360dead..b831dd9 100644 --- a/pages/post/_id.vue +++ b/pages/post/_id.vue @@ -102,15 +102,18 @@ export default { if (process.client) { if (!window.editorObj && window.Vditor) { const upload = { + accept: 'image/*, video/*, audio/*, text/*, application/*, .rar, .zip, .php, .pptx, .ppt, .doc, .docx, .txt, .xls, .xlsx', url: process.env.baseURL + '/public/file/upload', max: 10485760, // 10 MB - linkToImgUrl: process.env.baseURL + '/public/file/upload', + linkToImgUrl: process.env.baseURL + '/public/file/fetch', headers: { Authorization: 'Bearer ' + window.localStorage.token }, - filename: name => encodeURIComponent(name.replace(/\W/g, '')), - success (editor, msg) { - console.log(editor, msg) + filename: name => encodeURIComponent(name.replace(/[^(a-zA-Z0-9\u4E00-\u9FA5\.)]/g, '') // eslint-disable-line + .replace(/[\?\\/:|<>\*\[\]\(\)\$%\{\}@~]/g, '') // eslint-disable-line + .replace('/\\s/g', '')), + format (files, responseText) { + return responseText }, error: (_) => { this.$modal.show('dialog', {