@ecoding/components.antd 0.5.6 → 0.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -47,6 +47,9 @@ const MultipleImgUpload = (props) => {
|
|
|
47
47
|
const temp = [];
|
|
48
48
|
newItems && newItems.forEach((item) => {
|
|
49
49
|
if (item.url) {
|
|
50
|
+
// 防止重复拼接
|
|
51
|
+
item.url = domain ? item.url.replace(domain, '') : item.url;
|
|
52
|
+
item.url = domain ? `${domain}${item.url}` : item.url;
|
|
50
53
|
temp.push(item);
|
|
51
54
|
}
|
|
52
55
|
});
|
|
@@ -112,7 +115,11 @@ const MultipleImgUpload = (props) => {
|
|
|
112
115
|
if (!file.url && !file.preview) {
|
|
113
116
|
file.preview = yield getBase64(file.originFileObj);
|
|
114
117
|
}
|
|
115
|
-
|
|
118
|
+
let url;
|
|
119
|
+
if (file === null || file === void 0 ? void 0 : file.url) {
|
|
120
|
+
url = domain ? file.url.replace(domain, '') : file.url;
|
|
121
|
+
}
|
|
122
|
+
setPreviewImage(url || file.preview);
|
|
116
123
|
setPreviewOpen(true);
|
|
117
124
|
});
|
|
118
125
|
const uploadButton = (React.createElement("button", { style: Object.assign({ border: 0, background: 'none' }, disabled ? { cursor: 'not-allowed', opacity: 0.4 } : {}), type: "button" },
|
|
@@ -218,7 +225,7 @@ const MultipleImgUpload = (props) => {
|
|
|
218
225
|
});
|
|
219
226
|
}
|
|
220
227
|
else {
|
|
221
|
-
if (item.url) {
|
|
228
|
+
if (item === null || item === void 0 ? void 0 : item.url) {
|
|
222
229
|
// 防止重复拼接domain
|
|
223
230
|
item.url = domain ? item.url.replace(domain, "") : item.url;
|
|
224
231
|
item.url = domain ? `${domain}${item.url}` : item.url;
|
|
@@ -79,9 +79,16 @@ const SingleFileUpload = (props) => {
|
|
|
79
79
|
}));
|
|
80
80
|
}, []);
|
|
81
81
|
useEffect(() => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
let item = props.value;
|
|
83
|
+
if (typeof item === "string" && item) {
|
|
84
|
+
// 防止重复拼接domain
|
|
85
|
+
item = props.domain ? item.replace(props.domain, "") : item;
|
|
86
|
+
setFileUrl(item);
|
|
87
|
+
}
|
|
88
|
+
if (item === null || item === void 0 ? void 0 : item.url) {
|
|
89
|
+
// 防止重复拼接domain
|
|
90
|
+
item.url = props.domain ? item.url.replace(props.domain, "") : item.url;
|
|
91
|
+
setFileUrl(item.url);
|
|
85
92
|
}
|
|
86
93
|
}, [props.value]);
|
|
87
94
|
return (React.createElement(Space.Compact, { block: true },
|
|
@@ -171,7 +171,7 @@ const ImgUpload = (props) => {
|
|
|
171
171
|
item = props.domain ? item.replace(props.domain, "") : item;
|
|
172
172
|
setImageUrl(item);
|
|
173
173
|
}
|
|
174
|
-
if (item.url) {
|
|
174
|
+
if (item === null || item === void 0 ? void 0 : item.url) {
|
|
175
175
|
// 防止重复拼接domain
|
|
176
176
|
item.url = props.domain ? item.url.replace(props.domain, "") : item.url;
|
|
177
177
|
setImageUrl(item.url);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ecoding/components.antd",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.8",
|
|
4
4
|
"author": "cxc",
|
|
5
5
|
"homepage": "",
|
|
6
6
|
"license": "MIT",
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"antd": "^6.0.0",
|
|
48
48
|
"axios": "^1.1.2"
|
|
49
49
|
},
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "986b28ae9c14b15a968c0a442a0e8ac039766f8d"
|
|
51
51
|
}
|