mirror of https://github.com/jeecgboot/jeecg-boot
parent
7fecdf94e5
commit
48805484d4
|
@ -12,6 +12,7 @@
|
||||||
import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
|
import { onMountedOrActivated } from '/@/hooks/core/onMountedOrActivated';
|
||||||
import { getTenantId, getToken } from '/@/utils/auth';
|
import { getTenantId, getToken } from '/@/utils/auth';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
|
import { uploadFile } from '@/api/common/api';
|
||||||
|
|
||||||
type Lang = 'zh_CN' | 'en_US' | 'ja_JP' | 'ko_KR' | undefined;
|
type Lang = 'zh_CN' | 'en_US' | 'ja_JP' | 'ko_KR' | undefined;
|
||||||
|
|
||||||
|
@ -161,7 +162,7 @@
|
||||||
//update-begin-author:taoyan date:2022-5-24 for: VUEN-1090 markdown 无法上传
|
//update-begin-author:taoyan date:2022-5-24 for: VUEN-1090 markdown 无法上传
|
||||||
upload: {
|
upload: {
|
||||||
accept: 'image/*',
|
accept: 'image/*',
|
||||||
url: uploadUrl,
|
//url: uploadUrl,
|
||||||
fieldName: 'file',
|
fieldName: 'file',
|
||||||
extraData: { biz: 'markdown' },
|
extraData: { biz: 'markdown' },
|
||||||
setHeaders() {
|
setHeaders() {
|
||||||
|
@ -173,6 +174,23 @@
|
||||||
format(files, response) {
|
format(files, response) {
|
||||||
return formatResult(files, response);
|
return formatResult(files, response);
|
||||||
},
|
},
|
||||||
|
// 遍历文件上传并展示
|
||||||
|
async handler(files) {
|
||||||
|
const uploadSuccess = (res) => {
|
||||||
|
// {"success":true,"message":"markdown/aa_1653391146501.png","code":0,"result":null,"timestamp":1653391146501}'
|
||||||
|
if (res.success) {
|
||||||
|
vditorRef.value?.insertValue(`![${res.message}](${getFileAccessHttpUrl(res.message)})`);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
for (const file of files) {
|
||||||
|
let params = {
|
||||||
|
file: file,
|
||||||
|
filename: file.name,
|
||||||
|
data: { biz: 'markdown' },
|
||||||
|
};
|
||||||
|
await uploadFile(params, uploadSuccess);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
//update-end-author:taoyan date:2022-5-24 for: VUEN-1090 markdown 无法上传
|
//update-end-author:taoyan date:2022-5-24 for: VUEN-1090 markdown 无法上传
|
||||||
input: (v) => {
|
input: (v) => {
|
||||||
|
|
Loading…
Reference in New Issue