Commit f643013b authored by 涂伟's avatar 涂伟

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

parent 1f94fa8a
Pipeline #73187 passed with stages
......@@ -231,7 +231,10 @@ class PicturesWall extends React.Component<PicturesWallType> {
if (file.status === 'done') {
const files = fileList.map(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 };
});
this.setState({ fileList: files })
......@@ -273,8 +276,6 @@ class PicturesWall extends React.Component<PicturesWallType> {
// reader.onload = () => resolve(reader.result as string);
// })
// });
if (path && path.indexOf('http') === 0) {
return path
}
......@@ -284,6 +285,10 @@ class PicturesWall extends React.Component<PicturesWallType> {
if (path && path.indexOf('assets') === 0) {
return `${window.location.origin}/civweb4/${path}`.replace(/\\/g, '/')
}
if (path && (!path.includes('CityTemp') && !path.includes('图库'))) {
path = 'CityTemp\\图库\\' + path
}
if (previewFlag) {
return path
}
......
......@@ -568,6 +568,7 @@ const BookConfigNew = props => {
// }}
// width="100vw"
confirmLoading={modalLoading}
okText="保存并查看"
>
<div className={styles.top}>
<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