Skip to content

Commit e6746d2

Browse files
committed
fix: 修正bug
1 parent 290e578 commit e6746d2

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/components/Form/Editor.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
9292

9393
const getPictures = async (page: any = 1, search: any = null) => {
9494
const result = await get({
95-
url: '/api/admin/picture/getLists',
95+
url: '/api/admin/upload/image/getList',
9696
data: {
9797
page: page,
9898
...search,
@@ -110,7 +110,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
110110
checkPictures.map((item: any) => {
111111
picture.lists.map((pictureItem: any) => {
112112
if (pictureItem.id == item) {
113-
html = html + '<img src="' + pictureItem.path + '" />';
113+
html = html + '<img src="' + pictureItem.url + '" />';
114114
}
115115
});
116116
});
@@ -209,7 +209,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
209209
}
210210

211211
const result = await post({
212-
url: '/api/admin/picture/delete',
212+
url: '/api/admin/upload/image/delete',
213213
data: {
214214
id: id,
215215
},
@@ -236,7 +236,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
236236
}
237237

238238
const result = await post({
239-
url: 'admin/picture/delete',
239+
url: '/api/admin/upload/image/delete',
240240
data: {
241241
id: ids,
242242
},
@@ -252,7 +252,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
252252

253253
const onSubmitCrop = async () => {
254254
const result = await post({
255-
url: 'admin/picture/crop',
255+
url: '/api/admin/upload/image/crop',
256256
data: {
257257
id: imgId,
258258
file: cropper.getCroppedCanvas().toDataURL(),
@@ -308,16 +308,16 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
308308
var filetype =
309309
'.pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4';
310310
//后端接收上传文件的地址
311-
var upurl = '/api/admin/file/upload';
311+
var upurl = '/api/admin/upload/file/handle';
312312
//为不同插件指定文件类型及后端地址
313313
switch (meta.filetype) {
314314
case 'image':
315315
filetype = '.jpg, .jpeg, .png, .gif';
316-
upurl = '/api/admin/picture/upload';
316+
upurl = '/api/admin/upload/image/handle';
317317
break;
318318
case 'media':
319319
filetype = '.mp3, .mp4';
320-
upurl = '/api/admin/file/upload';
320+
upurl = '/api/admin/upload/file/handle';
321321
break;
322322
case 'file':
323323
default:
@@ -424,7 +424,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
424424
showUploadList={false}
425425
name={'file'}
426426
multiple={true}
427-
action={'/api/admin/picture/upload'}
427+
action={'/api/admin/upload/image/handle'}
428428
headers={{
429429
authorization: 'Bearer ' + sessionStorage['token'],
430430
}}
@@ -457,7 +457,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
457457
onClick={() => toggleChecked(item.id)}
458458
style={{ objectFit: 'cover' }}
459459
alt={item.name}
460-
src={item.path}
460+
src={item.url}
461461
width={'100%'}
462462
height={120}
463463
/>
@@ -468,7 +468,7 @@ const EditorPage: React.FC<any> = ({ value, onChange, height, width }) => {
468468
onClick={() => {
469469
changeCropBoxVisible(true);
470470
setImgSrc(
471-
item.path +
471+
item.url +
472472
'?timestamp' +
473473
new Date().getTime(),
474474
);

src/components/Form/ImageUploader.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ const ImageUploader: React.FC<ImageUploader> = ({
143143

144144
const onSubmitCrop = async () => {
145145
const result = await post({
146-
url: '/api/admin/picture/crop',
146+
url: '/api/admin/upload/image/crop',
147147
data: {
148148
id: imgId,
149149
file: cropper.getCroppedCanvas().toDataURL(),

0 commit comments

Comments
 (0)