We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdb5148 commit 1a95fb0Copy full SHA for 1a95fb0
src/commons/commonFuncs.js
@@ -22,17 +22,22 @@ export function GetBaseUrl() {
22
export function newGuid() {
23
return uuidv4();
24
}
25
-
+/**
26
+ *getImgSrc for both normal hosting and Reverse proxy
27
+ *
28
+ * @export
29
+ * @param {string} url the relative image url
30
+ * @returns real url
31
+ */
32
export function getImgSrc(url) {
33
if (typeof url !== 'string') return url;
34
const base = GetBaseUrl();
35
- if (!base || base === '/') return url;
- if (url.indexOf(base) >= 0) return url;
- return `${base}/${url}`;
36
+ return !base || base === '/' || url.indexOf(base) >= 0
37
+ ? url
38
+ : `${base}/${url}`;
39
40
+
41
/**
42
*Merge second array to first array if existed then update.
43
*
0 commit comments