generator-mico-cli 0.2.10 → 0.2.11
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/generators/micro-react/templates/apps/layout/docs/arch-/346/227/245/345/277/227/344/270/216/345/270/270/351/207/217.md +2 -2
- package/generators/micro-react/templates/apps/layout/docs/feature-/344/270/273/351/242/230/350/211/262/345/210/207/346/215/242.md +1 -1
- package/generators/micro-react/templates/apps/layout/src/common/request/sso.ts +1 -1
- package/generators/micro-react/templates/apps/layout/src/constants/index.ts +1 -1
- package/generators/micro-react/templates/apps/layout/src/layouts/components/header/index.tsx +3 -2
- package/package.json +1 -1
- package/generators/micro-react/templates/apps/layout/src/common/constants.ts +0 -38
|
@@ -37,7 +37,7 @@ const createLogger = (prefix: string) => ({
|
|
|
37
37
|
|
|
38
38
|
## 常量定义
|
|
39
39
|
|
|
40
|
-
集中管理魔法字符串,位于 `src/
|
|
40
|
+
集中管理魔法字符串,位于 `src/constants/index.ts`。
|
|
41
41
|
|
|
42
42
|
### ROUTES
|
|
43
43
|
|
|
@@ -95,7 +95,7 @@ export const STORAGE_KEYS = {
|
|
|
95
95
|
| 文件 | 说明 |
|
|
96
96
|
| ------------------------------------ | ------------- |
|
|
97
97
|
| `src/common/logger.ts` | Logger 工具 |
|
|
98
|
-
| `src/
|
|
98
|
+
| `src/constants/index.ts` | 常量定义 |
|
|
99
99
|
| `apps/homepage/src/common/logger.ts` | 子应用 Logger |
|
|
100
100
|
|
|
101
101
|
## 注意事项
|
package/generators/micro-react/templates/apps/layout/src/layouts/components/header/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useTheme } from '@/hooks/useTheme';
|
|
2
2
|
import { logout } from '@/common/auth';
|
|
3
|
-
import {
|
|
3
|
+
import { DEFAULT_NAME } from '@/constants';
|
|
4
|
+
import { ROUTES } from '@/constants';
|
|
4
5
|
import {
|
|
5
6
|
Avatar,
|
|
6
7
|
Divider,
|
|
@@ -57,7 +58,7 @@ const LayoutHeader: React.FC = () => {
|
|
|
57
58
|
{/* Logo */}
|
|
58
59
|
<div className="layout-header-logo">
|
|
59
60
|
<span className="logo-text">
|
|
60
|
-
{window.
|
|
61
|
+
{window.__MICO_CONFIG__?.appName || DEFAULT_NAME}
|
|
61
62
|
</span>
|
|
62
63
|
</div>
|
|
63
64
|
|
package/package.json
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 应用常量定义
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 路由路径常量
|
|
7
|
-
*/
|
|
8
|
-
export const ROUTES = {
|
|
9
|
-
/** 登录页 */
|
|
10
|
-
LOGIN: '/user/login',
|
|
11
|
-
/** 注册页 */
|
|
12
|
-
REGISTER: '/user/register',
|
|
13
|
-
/** 注册结果页 */
|
|
14
|
-
REGISTER_RESULT: '/user/register-result',
|
|
15
|
-
/** 无需认证的路由列表 */
|
|
16
|
-
NO_AUTH_ROUTES: ['/user/login', '/user/register', '/user/register-result'],
|
|
17
|
-
} as const;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 主题相关常量
|
|
21
|
-
*/
|
|
22
|
-
export const THEME = {
|
|
23
|
-
/** localStorage 存储键 */
|
|
24
|
-
STORAGE_KEY: '<%= projectName %>-theme',
|
|
25
|
-
/** 默认主题 */
|
|
26
|
-
DEFAULT: 'light' as const,
|
|
27
|
-
/** 可选主题值 */
|
|
28
|
-
VALUES: ['light', 'dark'] as const,
|
|
29
|
-
} as const;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* 存储键常量
|
|
33
|
-
*/
|
|
34
|
-
export const STORAGE_KEYS = {
|
|
35
|
-
APP_INFO: 'appInfo',
|
|
36
|
-
IS_SUPERUSER: 'is_superuser',
|
|
37
|
-
GROUPS: 'groups',
|
|
38
|
-
} as const;
|