Commit f643013b authored by 涂伟's avatar 涂伟

fix: '文件上传功能逻辑优化'

parent 1f94fa8a
Pipeline #73187 passed with stages
...@@ -231,7 +231,10 @@ class PicturesWall extends React.Component<PicturesWallType> { ...@@ -231,7 +231,10 @@ class PicturesWall extends React.Component<PicturesWallType> {
if (file.status === 'done') { if (file.status === 'done') {
const files = fileList.map(item => { const files = fileList.map(item => {
const { status, name, thumbUrl } = item; const { status, name, thumbUrl } = item;
const url = item.response && item.response.data || thumbUrl; let url = item.response && item.response.data || thumbUrl;
if (url && (!url.includes('CityTemp') && !url.includes('图库'))) {
url = 'CityTemp\\图库\\' + url
}
return { uid: uuid(8, 16), name, status, url }; return { uid: uuid(8, 16), name, status, url };
}); });
this.setState({ fileList: files }) this.setState({ fileList: files })
...@@ -273,8 +276,6 @@ class PicturesWall extends React.Component<PicturesWallType> { ...@@ -273,8 +276,6 @@ class PicturesWall extends React.Component<PicturesWallType> {
// reader.onload = () => resolve(reader.result as string); // reader.onload = () => resolve(reader.result as string);
// }) // })
// }); // });
if (path && path.indexOf('http') === 0) { if (path && path.indexOf('http') === 0) {
return path return path
} }
...@@ -284,6 +285,10 @@ class PicturesWall extends React.Component<PicturesWallType> { ...@@ -284,6 +285,10 @@ class PicturesWall extends React.Component<PicturesWallType> {
if (path && path.indexOf('assets') === 0) { if (path && path.indexOf('assets') === 0) {
return `${window.location.origin}/civweb4/${path}`.replace(/\\/g, '/') return `${window.location.origin}/civweb4/${path}`.replace(/\\/g, '/')
} }
if (path && (!path.includes('CityTemp') && !path.includes('图库'))) {
path = 'CityTemp\\图库\\' + path
}
if (previewFlag) { if (previewFlag) {
return path return path
} }
......
...@@ -568,6 +568,7 @@ const BookConfigNew = props => { ...@@ -568,6 +568,7 @@ const BookConfigNew = props => {
// }} // }}
// width="100vw" // width="100vw"
confirmLoading={modalLoading} confirmLoading={modalLoading}
okText="保存并查看"
> >
<div className={styles.top}> <div className={styles.top}>
<Form form={form} {...layout}> <Form form={form} {...layout}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment