generator-mico-cli 0.2.29 → 0.2.30
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.
- package/README.md +2 -0
- package/generators/micro-react/index.js +17 -1
- package/generators/micro-react/templates/CICD/start_dev.sh +11 -0
- package/generators/micro-react/templates/CICD/start_local.sh +9 -0
- package/generators/micro-react/templates/CICD/start_prod.sh +13 -0
- package/generators/micro-react/templates/CICD/start_test.sh +11 -0
- package/generators/micro-react/templates/apps/layout/config/config.dev.ts +9 -3
- package/generators/micro-react/templates/apps/layout/config/config.prod.development.ts +10 -0
- package/generators/micro-react/templates/apps/layout/config/config.prod.testing.ts +10 -0
- package/generators/micro-react/templates/apps/layout/config/config.prod.ts +12 -0
- package/generators/micro-react/templates/apps/layout/docs/feature-/345/233/275/351/231/205/345/214/226.md +121 -0
- package/generators/micro-react/templates/apps/layout/docs/feature-/345/276/256/345/211/215/347/253/257/346/250/241/345/274/217.md +8 -0
- package/generators/micro-react/templates/apps/layout/mock/menus.ts +14 -0
- package/generators/micro-react/templates/apps/layout/mock/pages.ts +22 -2
- package/generators/micro-react/templates/apps/layout/package.json +3 -2
- package/generators/micro-react/templates/apps/layout/src/app.tsx +58 -5
- package/generators/micro-react/templates/apps/layout/src/common/auth/index.ts +3 -0
- package/generators/micro-react/templates/apps/layout/src/common/auth/tenant.ts +25 -0
- package/generators/micro-react/templates/apps/layout/src/common/auth/type.ts +28 -2
- package/generators/micro-react/templates/apps/layout/src/common/intl/formatLayoutMessage.ts +30 -0
- package/generators/micro-react/templates/apps/layout/src/common/intl/index.ts +6 -0
- package/generators/micro-react/templates/apps/layout/src/common/intl/intlRuntime.ts +14 -0
- package/generators/micro-react/templates/apps/layout/src/common/intl/localeMapping.ts +30 -0
- package/generators/micro-react/templates/apps/layout/src/common/intl/types.ts +14 -0
- package/generators/micro-react/templates/apps/layout/src/common/intl/useLayoutIntl.ts +40 -0
- package/generators/micro-react/templates/apps/layout/src/common/logger.ts +3 -4
- package/generators/micro-react/templates/apps/layout/src/common/menu/types.ts +27 -0
- package/generators/micro-react/templates/apps/layout/src/common/micro/types.ts +23 -0
- package/generators/micro-react/templates/apps/layout/src/common/request/sso.ts +74 -15
- package/generators/micro-react/templates/apps/layout/src/common/request/token-refresh.ts +2 -0
- package/generators/micro-react/templates/apps/layout/src/components/MicroAppLoader/index.tsx +28 -6
- package/generators/micro-react/templates/apps/layout/src/components/RightContent/TenantDropdown.tsx +76 -0
- package/generators/micro-react/templates/apps/layout/src/components/RightContent/index.ts +1 -0
- package/generators/micro-react/templates/apps/layout/src/components/RightContent/tenant-dropdown.less +48 -0
- package/generators/micro-react/templates/apps/layout/src/constants/index.ts +1 -0
- package/generators/micro-react/templates/apps/layout/src/hooks/index.ts +1 -0
- package/generators/micro-react/templates/apps/layout/src/hooks/useMenuState.ts +18 -0
- package/generators/micro-react/templates/apps/layout/src/hooks/useTenant.ts +41 -0
- package/generators/micro-react/templates/apps/layout/src/layouts/components/header/index.tsx +4 -1
- package/generators/micro-react/templates/apps/layout/src/layouts/components/menu/index.tsx +18 -6
- package/generators/micro-react/templates/apps/layout/src/locales/en-US.ts +11 -0
- package/generators/micro-react/templates/apps/layout/src/locales/zh-CN.ts +10 -0
- package/generators/micro-react/templates/apps/layout/src/pages/Home/index.less +27 -0
- package/generators/micro-react/templates/apps/layout/src/pages/Home/index.tsx +108 -12
- package/generators/micro-react/templates/apps/layout/src/requestErrorConfig.ts +2 -1
- package/generators/micro-react/templates/apps/layout/src/services/user.ts +53 -2
- package/generators/micro-react/templates/apps/layout/typings.d.ts +16 -0
- package/generators/micro-react/templates/docs/package-shared.md +189 -0
- package/generators/micro-react/templates/package.json +1 -1
- package/generators/micro-react/templates/packages/common-intl/README.md +3 -1
- package/generators/micro-react/templates/packages/common-intl/package.json +1 -1
- package/generators/micro-react/templates/packages/common-intl/src/index.ts +4 -2
- package/generators/micro-react/templates/packages/common-intl/src/intl.ts +104 -8
- package/generators/micro-react/templates/packages/common-intl/src/umiLocaleBridge.ts +101 -0
- package/generators/micro-react/templates/packages/shared/README.md +120 -0
- package/generators/micro-react/templates/packages/shared/package.json +26 -0
- package/generators/micro-react/templates/packages/shared/services/common/index.ts +43 -0
- package/generators/micro-react/templates/packages/shared/services/index.ts +21 -0
- package/generators/micro-react/templates/packages/shared/services/request.ts +43 -0
- package/generators/micro-react/templates/packages/shared/timezone/index.ts +228 -0
- package/generators/micro-react/templates/packages/shared/tsconfig.json +20 -0
- package/generators/micro-react/templates/scripts/apply-sentry-plugin.ts +6 -1
- package/generators/micro-react/templates/turbo.json +9 -1
- package/generators/subapp-react/templates/homepage/config/config.ts +10 -0
- package/generators/subapp-react/templates/homepage/docs/feature-/345/233/275/351/231/205/345/214/226.md +124 -0
- package/generators/subapp-react/templates/homepage/package.json +2 -1
- package/generators/subapp-react/templates/homepage/src/app.tsx +100 -5
- package/generators/subapp-react/templates/homepage/src/common/intl/index.ts +15 -0
- package/generators/subapp-react/templates/homepage/src/common/intl/intlRuntime.ts +14 -0
- package/generators/subapp-react/templates/homepage/src/common/intl/localeMapping.ts +24 -0
- package/generators/subapp-react/templates/homepage/src/common/intl/subappIntlConfig.ts +28 -0
- package/generators/subapp-react/templates/homepage/src/common/intl/subappLocale.ts +18 -0
- package/generators/subapp-react/templates/homepage/src/common/intl/subappOwnIntl.ts +63 -0
- package/generators/subapp-react/templates/homepage/src/common/intl/types.ts +14 -0
- package/generators/subapp-react/templates/homepage/src/common/intl/useSubappIntl.ts +61 -0
- package/generators/subapp-react/templates/homepage/src/common/locale.ts +80 -0
- package/generators/subapp-react/templates/homepage/src/common/mainApp.ts +2 -0
- package/generators/subapp-react/templates/homepage/src/locales/en-US.ts +6 -0
- package/generators/subapp-react/templates/homepage/src/locales/zh-CN.ts +6 -0
- package/generators/subapp-react/templates/homepage/src/pages/index.less +10 -0
- package/generators/subapp-react/templates/homepage/src/pages/index.tsx +51 -0
- package/generators/subapp-react/templates/homepage/typings.d.ts +12 -0
- package/package.json +1 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { initIntl, type ILang } from '<%= packageScope %>/common-intl';
|
|
2
|
+
import { setLocaleToStorage } from '@/common/locale';
|
|
3
|
+
import { getSubappIntlInitOptions } from './subappIntlConfig';
|
|
4
|
+
import { ilangToUmiLocale, umiLocaleToILang } from './localeMapping';
|
|
5
|
+
import { getSubappCurrentLocale } from './subappLocale';
|
|
6
|
+
|
|
7
|
+
type TI18nFn = (opts: {
|
|
8
|
+
key: string;
|
|
9
|
+
defaultMessage: string;
|
|
10
|
+
interpolations?: (string | number | boolean)[];
|
|
11
|
+
}) => string;
|
|
12
|
+
|
|
13
|
+
type TFetchFn = (params: {
|
|
14
|
+
requestInstance: (url: string, options?: unknown) => Promise<unknown>;
|
|
15
|
+
messageInstance: { error: (msg: string) => void; warning: (msg: string) => void };
|
|
16
|
+
lang: ILang;
|
|
17
|
+
localeRequestUrl?: string;
|
|
18
|
+
}) => Promise<unknown>;
|
|
19
|
+
|
|
20
|
+
function createSubappOwnIntl(): {
|
|
21
|
+
i18nFn: TI18nFn | null;
|
|
22
|
+
fetchFn: TFetchFn | null;
|
|
23
|
+
tag: string | undefined;
|
|
24
|
+
} {
|
|
25
|
+
const opts = getSubappIntlInitOptions();
|
|
26
|
+
if (!opts?.tag || !opts.app_name) {
|
|
27
|
+
return { i18nFn: null, fetchFn: null, tag: undefined };
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const { fetchMultilingualData, i18n } = initIntl({
|
|
31
|
+
...opts,
|
|
32
|
+
getLocale: () => umiLocaleToILang(getSubappCurrentLocale()),
|
|
33
|
+
setLocale: (lang: ILang) => {
|
|
34
|
+
setLocaleToStorage(ilangToUmiLocale(lang));
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
i18nFn: i18n as TI18nFn,
|
|
40
|
+
fetchFn: fetchMultilingualData as TFetchFn,
|
|
41
|
+
tag: opts.tag,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const subappOwnIntlRuntime = createSubappOwnIntl();
|
|
46
|
+
|
|
47
|
+
export function isSubappOwnIntlEnabled(): boolean {
|
|
48
|
+
return subappOwnIntlRuntime.i18nFn != null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function getSubappOwnIntlTag(): string | undefined {
|
|
52
|
+
return subappOwnIntlRuntime.tag;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** 独立 intl 实例的 i18n;未配置时为 `null` */
|
|
56
|
+
export function getSubappOwnI18n(): TI18nFn | null {
|
|
57
|
+
return subappOwnIntlRuntime.i18nFn;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** 与默认 tag 的 fetch 相同入参;未配置独立 intl 时为 `null` */
|
|
61
|
+
export function getSubappOwnFetchMultilingualData(): TFetchFn | null {
|
|
62
|
+
return subappOwnIntlRuntime.fetchFn;
|
|
63
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 运行时 common-intl 配置(见 window.__MICO_CONFIG__.intl,兼容 commonIntl)
|
|
3
|
+
*/
|
|
4
|
+
export interface IMicoConfigCommonIntl {
|
|
5
|
+
/** 多语言中台 tag */
|
|
6
|
+
tag: string;
|
|
7
|
+
app_name: string;
|
|
8
|
+
indexedDBParams?: {
|
|
9
|
+
dbName?: string;
|
|
10
|
+
dbVersion?: number;
|
|
11
|
+
storeName?: string;
|
|
12
|
+
keyPathKey?: string;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { i18n } from '<%= packageScope %>/common-intl';
|
|
2
|
+
import { useIntl } from '@umijs/max';
|
|
3
|
+
import { getSubappCurrentLocale } from './subappLocale';
|
|
4
|
+
import { isCommonIntlEnabled } from './intlRuntime';
|
|
5
|
+
import { getSubappOwnI18n, isSubappOwnIntlEnabled, getSubappOwnIntlTag } from './subappOwnIntl';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* 子应用统一国际化 Hook:
|
|
9
|
+
* - 配置了 {@link getSubappIntlInitOptions} 时:优先独立 intl 实例的 `i18n`,无命中再 Umi
|
|
10
|
+
* - 否则与 layout `useLayoutIntl` 一致:未启用 commonIntl 时仅 Umi;启用后包内 `i18n` 优先,无命中再 Umi
|
|
11
|
+
*/
|
|
12
|
+
export function useSubappIntl() {
|
|
13
|
+
const umiIntl = useIntl();
|
|
14
|
+
const commonIntlEnabled = isCommonIntlEnabled();
|
|
15
|
+
const locale = getSubappCurrentLocale();
|
|
16
|
+
const subappOwnIntl = isSubappOwnIntlEnabled();
|
|
17
|
+
const ownI18n = getSubappOwnI18n();
|
|
18
|
+
const subappOwnIntlTag = getSubappOwnIntlTag();
|
|
19
|
+
|
|
20
|
+
const formatMessage = (
|
|
21
|
+
descriptor: { id: string; defaultMessage?: string },
|
|
22
|
+
values?: Record<string, string | number | boolean | Date | null | undefined>,
|
|
23
|
+
): string => {
|
|
24
|
+
const dm = descriptor.defaultMessage ?? descriptor.id;
|
|
25
|
+
const fromUmi = umiIntl.formatMessage(descriptor, values);
|
|
26
|
+
|
|
27
|
+
if (subappOwnIntl && ownI18n) {
|
|
28
|
+
const fromOwn = ownI18n({
|
|
29
|
+
key: descriptor.id,
|
|
30
|
+
defaultMessage: dm,
|
|
31
|
+
});
|
|
32
|
+
if (fromOwn === dm && fromUmi !== fromOwn) {
|
|
33
|
+
return fromUmi;
|
|
34
|
+
}
|
|
35
|
+
return fromOwn;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!commonIntlEnabled) {
|
|
39
|
+
return fromUmi;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const fromIntl = i18n({
|
|
43
|
+
key: descriptor.id,
|
|
44
|
+
defaultMessage: dm,
|
|
45
|
+
});
|
|
46
|
+
if (fromIntl === dm && fromUmi !== fromIntl) {
|
|
47
|
+
return fromUmi;
|
|
48
|
+
}
|
|
49
|
+
return fromIntl;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
commonIntlEnabled,
|
|
54
|
+
formatMessage,
|
|
55
|
+
locale,
|
|
56
|
+
/** 是否启用子应用内独立 initIntl 配置 */
|
|
57
|
+
subappOwnIntl,
|
|
58
|
+
/** 独立 intl 的 tag(仅 subappOwnIntl 为 true 时有值) */
|
|
59
|
+
subappOwnIntlTag,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 语言管理(与主应用 layout `umi_locale` 规则一致:URL > localStorage > 浏览器)
|
|
3
|
+
* 独立运行子应用时使用;qiankun 下 {@link getSubappCurrentLocale} 优先主应用 props.locale
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const LOCALE_STORAGE_KEY = 'umi_locale';
|
|
7
|
+
const URL_PARAM_KEY = 'lang';
|
|
8
|
+
|
|
9
|
+
export const SUPPORTED_LOCALES = ['zh-CN', 'en-US'] as const;
|
|
10
|
+
export type SupportedLocale = (typeof SUPPORTED_LOCALES)[number];
|
|
11
|
+
|
|
12
|
+
export const LOCALE = {
|
|
13
|
+
ZH_CN: 'zh-CN',
|
|
14
|
+
EN_US: 'en-US',
|
|
15
|
+
} as const;
|
|
16
|
+
|
|
17
|
+
const DEFAULT_LOCALE: SupportedLocale = 'en-US';
|
|
18
|
+
|
|
19
|
+
function getLocaleFromUrl(): string | null {
|
|
20
|
+
if (typeof window === 'undefined') {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
24
|
+
return urlParams.get(URL_PARAM_KEY);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getLocaleFromStorage(): string | null {
|
|
28
|
+
if (typeof window === 'undefined') {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
return localStorage.getItem(LOCALE_STORAGE_KEY);
|
|
33
|
+
} catch {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function getBrowserLocale(): SupportedLocale {
|
|
39
|
+
if (typeof window === 'undefined') {
|
|
40
|
+
return DEFAULT_LOCALE;
|
|
41
|
+
}
|
|
42
|
+
const browserLang = navigator.language || (navigator as { userLanguage?: string }).userLanguage;
|
|
43
|
+
const locales = [...SUPPORTED_LOCALES];
|
|
44
|
+
if (locales.includes(browserLang as SupportedLocale)) {
|
|
45
|
+
return browserLang as SupportedLocale;
|
|
46
|
+
}
|
|
47
|
+
const langPrefix = browserLang.split('-')[0];
|
|
48
|
+
const matchedLocale = locales.find((locale) => locale.startsWith(langPrefix));
|
|
49
|
+
return matchedLocale || DEFAULT_LOCALE;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function isValidLocale(locale: string | null): locale is SupportedLocale {
|
|
53
|
+
if (!locale) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return ([...SUPPORTED_LOCALES] as string[]).includes(locale);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function getCurrentLocale(): SupportedLocale {
|
|
60
|
+
const urlLocale = getLocaleFromUrl();
|
|
61
|
+
if (isValidLocale(urlLocale)) {
|
|
62
|
+
return urlLocale;
|
|
63
|
+
}
|
|
64
|
+
const storageLocale = getLocaleFromStorage();
|
|
65
|
+
if (isValidLocale(storageLocale)) {
|
|
66
|
+
return storageLocale;
|
|
67
|
+
}
|
|
68
|
+
return getBrowserLocale();
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function setLocaleToStorage(locale: SupportedLocale): void {
|
|
72
|
+
if (typeof window === 'undefined') {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
try {
|
|
76
|
+
localStorage.setItem(LOCALE_STORAGE_KEY, locale);
|
|
77
|
+
} catch (error) {
|
|
78
|
+
console.error('Failed to save locale to localStorage:', error);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -15,6 +15,8 @@ export interface IMicroAppProps {
|
|
|
15
15
|
request?: <T = any>(url: string, options?: any) => Promise<T>;
|
|
16
16
|
/** 当前路由路径(由主应用传递,用于子应用内部路由切换) */
|
|
17
17
|
routePath?: string;
|
|
18
|
+
/** 当前语言(与主应用 getCurrentLocale 一致,如 zh-CN / en-US),供国际化与 common-intl 对齐 */
|
|
19
|
+
locale?: string;
|
|
18
20
|
/**
|
|
19
21
|
* 按钮权限列表(与主应用 fetchUserInfo.button_perms 一致,由主应用 MicroAppLoader 注入)
|
|
20
22
|
*/
|
|
@@ -28,6 +28,16 @@
|
|
|
28
28
|
margin-bottom: @spacing-lg;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
&-intl-hint {
|
|
32
|
+
margin-bottom: @spacing-sm;
|
|
33
|
+
color: @color-text-2;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&-intl-meta {
|
|
37
|
+
font-size: @font-size-sm;
|
|
38
|
+
margin-top: @spacing-md;
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
&-card {
|
|
32
42
|
padding: @card-padding;
|
|
33
43
|
// 卡片背景色 - 使用 color-text-5(亮色模式为白色)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import PermissionFilter from '@/components/PermissionFilter';
|
|
2
|
+
import { useSubappIntl } from '@/common/intl';
|
|
2
3
|
import { getRequestSource, request } from '@/common/request';
|
|
3
4
|
import {
|
|
4
5
|
Alert,
|
|
@@ -55,6 +56,14 @@ interface IListItem {
|
|
|
55
56
|
* 4. Less 变量自动适配主应用的主题切换
|
|
56
57
|
*/
|
|
57
58
|
export default function HomePage() {
|
|
59
|
+
const {
|
|
60
|
+
formatMessage,
|
|
61
|
+
commonIntlEnabled,
|
|
62
|
+
locale,
|
|
63
|
+
subappOwnIntl,
|
|
64
|
+
subappOwnIntlTag,
|
|
65
|
+
} = useSubappIntl();
|
|
66
|
+
|
|
58
67
|
const [loading, setLoading] = useState(false);
|
|
59
68
|
const [userInfo, setUserInfo] = useState<IUserInfo | null>(null);
|
|
60
69
|
const [stats, setStats] = useState<IStatsData | null>(null);
|
|
@@ -144,6 +153,48 @@ export default function HomePage() {
|
|
|
144
153
|
|
|
145
154
|
<Divider />
|
|
146
155
|
|
|
156
|
+
<Card
|
|
157
|
+
title={formatMessage({
|
|
158
|
+
id: 'page.subapp.home.demoSectionTitle',
|
|
159
|
+
defaultMessage: '国际化示例',
|
|
160
|
+
})}
|
|
161
|
+
style={{ marginBottom: 16 }}
|
|
162
|
+
>
|
|
163
|
+
<Title heading={4}>
|
|
164
|
+
{formatMessage({
|
|
165
|
+
id: 'page.subapp.home.title',
|
|
166
|
+
defaultMessage: '子应用首页',
|
|
167
|
+
})}
|
|
168
|
+
</Title>
|
|
169
|
+
<Paragraph className="subapp-intl-hint">
|
|
170
|
+
common-intl 优先样例(使用主应用的tag):
|
|
171
|
+
{formatMessage({
|
|
172
|
+
id: 'cs_web_workbench_userlist_chat',
|
|
173
|
+
defaultMessage: '看到该文案代表未启用 主应用commonIntl 或中台无该 key',
|
|
174
|
+
})}
|
|
175
|
+
</Paragraph>
|
|
176
|
+
<Paragraph className="subapp-intl-hint">
|
|
177
|
+
common-intl 优先样例(使用子应用的tag):
|
|
178
|
+
{formatMessage({
|
|
179
|
+
id: 'sdk_h5_ticket_you_can_leave_us_a_message_we_will_reply_within_24_hours',
|
|
180
|
+
defaultMessage: '看到该文案代表未启用 子应用commonIntl 或中台无该 key',
|
|
181
|
+
})}
|
|
182
|
+
</Paragraph>
|
|
183
|
+
<Paragraph className="<%= appName %>-intl-hint">
|
|
184
|
+
仅子应用 locales 的 key(intl 通常无该 key):
|
|
185
|
+
{formatMessage({
|
|
186
|
+
id: 'page.subapp.home.umiOnly',
|
|
187
|
+
defaultMessage: '若仍见此默认文案,请检查 locales 是否注册该 id',
|
|
188
|
+
})}
|
|
189
|
+
</Paragraph>
|
|
190
|
+
<Paragraph type="secondary" className="<%= appName %>-intl-meta">
|
|
191
|
+
commonIntlEnabled: {String(commonIntlEnabled)} · locale: {locale}
|
|
192
|
+
{subappOwnIntl
|
|
193
|
+
? ` · subappOwnIntl: true · tag: ${subappOwnIntlTag ?? '-'}`
|
|
194
|
+
: ' · subappOwnIntl: false'}
|
|
195
|
+
</Paragraph>
|
|
196
|
+
</Card>
|
|
197
|
+
|
|
147
198
|
{/* 请求示例 */}
|
|
148
199
|
<Spin loading={loading} style={{ display: 'block' }}>
|
|
149
200
|
<Card
|
|
@@ -87,6 +87,18 @@ declare global {
|
|
|
87
87
|
__MICO_CONFIG__?: {
|
|
88
88
|
appName?: string;
|
|
89
89
|
apiBaseUrl?: string;
|
|
90
|
+
/** 多语言中台(与 commonIntl 二选一字段名,见 common-intl intlRuntime) */
|
|
91
|
+
intl?: {
|
|
92
|
+
tag: string;
|
|
93
|
+
app_name: string;
|
|
94
|
+
indexedDBParams?: { dbName?: string };
|
|
95
|
+
};
|
|
96
|
+
/** 多语言中台保底配置(可选);与 packages/common-intl README、子应用可选 intl 模块配合 */
|
|
97
|
+
commonIntl?: {
|
|
98
|
+
tag: string;
|
|
99
|
+
app_name: string;
|
|
100
|
+
indexedDBParams?: { dbName?: string };
|
|
101
|
+
};
|
|
90
102
|
[key: string]: unknown;
|
|
91
103
|
};
|
|
92
104
|
}
|