|
|
@ -12,10 +12,12 @@ import {
|
|
|
|
t,
|
|
|
|
t,
|
|
|
|
fetchGlobalClientConfig,
|
|
|
|
fetchGlobalClientConfig,
|
|
|
|
isDevelopment,
|
|
|
|
isDevelopment,
|
|
|
|
|
|
|
|
isProduction,
|
|
|
|
setErrorHook,
|
|
|
|
setErrorHook,
|
|
|
|
showToasts,
|
|
|
|
showToasts,
|
|
|
|
parseUrlStr,
|
|
|
|
parseUrlStr,
|
|
|
|
onLanguageLoaded,
|
|
|
|
onLanguageLoaded,
|
|
|
|
|
|
|
|
version,
|
|
|
|
} from 'tailchat-shared';
|
|
|
|
} from 'tailchat-shared';
|
|
|
|
import { getPopupContainer } from './utils/dom-helper';
|
|
|
|
import { getPopupContainer } from './utils/dom-helper';
|
|
|
|
import { getUserJWT } from './utils/jwt-helper';
|
|
|
|
import { getUserJWT } from './utils/jwt-helper';
|
|
|
@ -121,7 +123,16 @@ setErrorHook((err) => {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 获取前端配置
|
|
|
|
* 获取前端配置
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
fetchGlobalClientConfig().catch((e) => {
|
|
|
|
fetchGlobalClientConfig()
|
|
|
|
|
|
|
|
.then((config) => {
|
|
|
|
|
|
|
|
if (isProduction && !config.disableTelemetry) {
|
|
|
|
|
|
|
|
// 发送遥测信息
|
|
|
|
|
|
|
|
fetch(
|
|
|
|
|
|
|
|
`https://tianji.moonrailgun.com/telemetry/clnzoxcy10001vy2ohi4obbi0/blank.gif?name=tailchat&url=${window.location.origin}&v=${version}`
|
|
|
|
|
|
|
|
).catch(() => {});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((e) => {
|
|
|
|
showErrorToasts(t('全局配置加载失败'));
|
|
|
|
showErrorToasts(t('全局配置加载失败'));
|
|
|
|
console.error('全局配置加载失败', e);
|
|
|
|
console.error('全局配置加载失败', e);
|
|
|
|
});
|
|
|
|
});
|
|
|
|