feat: 修复了全局配置获取路径问题

release/desktop
moonrailgun 3 years ago
parent 1b8e81d4fd
commit d38b912d4d

@ -84,6 +84,7 @@ export {
// model
export { fetchAvailableServices } from './model/common';
export { fetchGlobalConfig } from './model/config';
export {
createDMConverse,
appendDMConverseMembers,

@ -1,6 +1,4 @@
import { request } from '../api/request';
import { t } from '../i18n';
import { showErrorToasts } from '../manager/ui';
/**
*
@ -23,7 +21,7 @@ export function getGlobalConfig() {
};
}
export async function fetchConfig() {
export async function fetchGlobalConfig(): Promise<GlobalConfig> {
const { data: config } = await request.get('/api/config/global');
globalConfig = {
@ -33,11 +31,3 @@ export async function fetchConfig() {
return config;
}
/**
*
*/
fetchConfig().catch((e) => {
showErrorToasts(t('全局配置加载失败'));
console.error('全局配置加载失败', e);
});

@ -8,6 +8,9 @@ import {
setStorage,
setToasts,
setTokenGetter,
showErrorToasts,
t,
fetchGlobalConfig,
} from 'tailchat-shared';
import { getPopupContainer } from './utils/dom-helper';
import { getUserJWT } from './utils/jwt-helper';
@ -50,3 +53,11 @@ setGlobalLoading((text) => {
return hide;
});
/**
*
*/
fetchGlobalConfig().catch((e) => {
showErrorToasts(t('全局配置加载失败'));
console.error('全局配置加载失败', e);
});

Loading…
Cancel
Save