Skip to content

Commit 9be7d9a

Browse files
committed
chore: update log static url
1 parent 94653bc commit 9be7d9a

File tree

1 file changed

+5
-1
lines changed
  • packages/site-components/src/components/td-doc-changelog

1 file changed

+5
-1
lines changed

packages/site-components/src/components/td-doc-changelog/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const locale = getLocale();
1313

1414
const OFFICIAL_DOMAINS = ['tencent.com', 'woa.com'];
1515

16+
// 静态资源统一的地址,支持tencent.com 和 woa.com的跨域请求
17+
const OFFICIAL_STATIC_DOMAINS = 'static.tdesign.tencent.com';
1618
const SPECIAL_NAME_MAP = {
1719
qrcode: 'QRCode',
1820
};
@@ -21,7 +23,9 @@ function getLogUrlPrefix() {
2123
const currentUrl = window.location.href;
2224
const framework = currentUrl.split('/')[3];
2325
const isOfficial = OFFICIAL_DOMAINS.some((domain) => location.hostname.includes(domain));
24-
return `${location.origin}${isOfficial ? `/${framework}` : ''}`;
26+
if (isOfficial) return OFFICIAL_STATIC_DOMAINS + `/${framework}`;
27+
28+
return location.origin;
2529
}
2630

2731
function getCompName() {

0 commit comments

Comments
 (0)