添加上传能力
This commit is contained in:
parent
9b455e6f25
commit
0cbd50eeda
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
@ -6,6 +6,7 @@
|
|||||||
"eslintignore",
|
"eslintignore",
|
||||||
"fontawesome",
|
"fontawesome",
|
||||||
"fortawesome",
|
"fortawesome",
|
||||||
|
"gotop",
|
||||||
"hljs",
|
"hljs",
|
||||||
"navication",
|
"navication",
|
||||||
"nuxt",
|
"nuxt",
|
||||||
|
@ -102,15 +102,18 @@ export default {
|
|||||||
if (process.client) {
|
if (process.client) {
|
||||||
if (!window.editorObj && window.Vditor) {
|
if (!window.editorObj && window.Vditor) {
|
||||||
const upload = {
|
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',
|
url: process.env.baseURL + '/public/file/upload',
|
||||||
max: 10485760, // 10 MB
|
max: 10485760, // 10 MB
|
||||||
linkToImgUrl: process.env.baseURL + '/public/file/upload',
|
linkToImgUrl: process.env.baseURL + '/public/file/fetch',
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: 'Bearer ' + window.localStorage.token
|
Authorization: 'Bearer ' + window.localStorage.token
|
||||||
},
|
},
|
||||||
filename: name => encodeURIComponent(name.replace(/\W/g, '')),
|
filename: name => encodeURIComponent(name.replace(/[^(a-zA-Z0-9\u4E00-\u9FA5\.)]/g, '') // eslint-disable-line
|
||||||
success (editor, msg) {
|
.replace(/[\?\\/:|<>\*\[\]\(\)\$%\{\}@~]/g, '') // eslint-disable-line
|
||||||
console.log(editor, msg)
|
.replace('/\\s/g', '')),
|
||||||
|
format (files, responseText) {
|
||||||
|
return responseText
|
||||||
},
|
},
|
||||||
error: (_) => {
|
error: (_) => {
|
||||||
this.$modal.show('dialog', {
|
this.$modal.show('dialog', {
|
||||||
|
Loading…
Reference in New Issue
Block a user