create-tengits-app 1.0.4 → 1.0.6
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/package.json +1 -1
- package/packages/main/.env +1 -1
- package/packages/main/dist/manifest.json +2 -2
- package/packages/main/rsbuild.config.ts +6 -9
- package/packages/main/src/App.tsx +2 -2
- package/packages/main/src/i18n.js +3 -3
- package/packages/main/src/index.jsx +0 -1
- package/packages/main/src/menus.jsx +72 -72
- package/packages/main/src/pages/Login/index.tsx +2 -2
package/package.json
CHANGED
package/packages/main/.env
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"/static/js/vendors-node_modules_pnpm_rspack_core_1_4_8__swc_helpers_0_5_17_node_modules_rspack_core_dist-6d1c2b.js",
|
|
8
8
|
"/index.html",
|
|
9
9
|
"/static/js/async/node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-ponyfill_js_lazy-co-6570d5.js.map",
|
|
10
|
-
"/index.a77ae4993f7bf23d.hot-update.js.map",
|
|
11
10
|
"/static/js/index.js.map",
|
|
11
|
+
"/index.804f6c7ffad5ca7d.hot-update.js.map",
|
|
12
12
|
"/static/js/lib-react.js.map",
|
|
13
13
|
"/static/js/vendors-node_modules_pnpm_rspack_core_1_4_8__swc_helpers_0_5_17_node_modules_rspack_core_dist-6d1c2b.js.map"
|
|
14
14
|
],
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"assets": [
|
|
18
18
|
"static/js/vendors-node_modules_pnpm_rspack_core_1_4_8__swc_helpers_0_5_17_node_modules_rspack_core_dist-6d1c2b.js.map",
|
|
19
19
|
"static/js/lib-react.js.map",
|
|
20
|
-
"index.a77ae4993f7bf23d.hot-update.js.map",
|
|
21
20
|
"static/js/index.js.map",
|
|
21
|
+
"index.804f6c7ffad5ca7d.hot-update.js.map",
|
|
22
22
|
"static/js/async/node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-ponyfill_js_lazy-co-6570d5.js.map"
|
|
23
23
|
],
|
|
24
24
|
"html": [
|
|
@@ -44,15 +44,12 @@ export default defineConfig(({ env, envMode }) => {
|
|
|
44
44
|
},
|
|
45
45
|
server: {
|
|
46
46
|
port: 3000,
|
|
47
|
-
proxy: [
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// ws: true,
|
|
54
|
-
// }
|
|
55
|
-
],
|
|
47
|
+
proxy: [{
|
|
48
|
+
context: ['/tladapter', '/tlai', '/api', '/testuser', '/crud', '/ttos', '/saas', '/web', '/adapter', '/tlbi', '/sign'],
|
|
49
|
+
target: parsed.VITE_REACT_APP_HOST,
|
|
50
|
+
changeOrigin: true,
|
|
51
|
+
ws: true,
|
|
52
|
+
}],
|
|
56
53
|
},
|
|
57
54
|
output: {
|
|
58
55
|
legalComments: 'none',
|
|
@@ -4,7 +4,7 @@ import i18n from './i18n';
|
|
|
4
4
|
import { getMenus } from './menus';
|
|
5
5
|
import { customRoutes, otherRoutes } from './routes';
|
|
6
6
|
|
|
7
|
-
const {
|
|
7
|
+
const { VITE_SYSTEM_NAME } = import.meta.env;
|
|
8
8
|
|
|
9
9
|
interface MenuItem {
|
|
10
10
|
id: string | number;
|
|
@@ -81,7 +81,7 @@ function App() {
|
|
|
81
81
|
<TUIApp
|
|
82
82
|
appConfigDefaultStatus={{
|
|
83
83
|
isNotJumpTongyi: true,
|
|
84
|
-
systemName:
|
|
84
|
+
systemName: VITE_SYSTEM_NAME,
|
|
85
85
|
logoutProps: {
|
|
86
86
|
api: '/saas/user/logout',
|
|
87
87
|
},
|
|
@@ -34,7 +34,7 @@ const savedLanguage = localStorage.getItem('language') || getBrowserLanguage();
|
|
|
34
34
|
const aiI18n = i18n.createInstance();
|
|
35
35
|
// 创建新的i18n实例,避免与其他实例冲突
|
|
36
36
|
|
|
37
|
-
const allNamespaces = ['
|
|
37
|
+
const allNamespaces = ['Common'];
|
|
38
38
|
|
|
39
39
|
// 创建新的i18n实例,避免与其他实例冲突
|
|
40
40
|
const nsMap = {
|
|
@@ -51,7 +51,7 @@ export const initializeAiI18n = async (options = {}) => {
|
|
|
51
51
|
// 使用Backend和initReactI18next插件
|
|
52
52
|
// 根据当前路由设置默认命名空间
|
|
53
53
|
const currentPath = window.location.pathname;
|
|
54
|
-
let defaultNS = '
|
|
54
|
+
let defaultNS = 'Common'; // 默认命名空间
|
|
55
55
|
|
|
56
56
|
// 根据路由路径设置对应的命名空间
|
|
57
57
|
// 使用nsMap来映射路径到命名空间
|
|
@@ -81,7 +81,7 @@ export const initializeAiI18n = async (options = {}) => {
|
|
|
81
81
|
ns: allNamespaces, // 指定命名空间
|
|
82
82
|
// ns: initialNamespaces, // 只指定初始命名空间
|
|
83
83
|
defaultNS, // 默认命名空间
|
|
84
|
-
fallbackNS: '
|
|
84
|
+
fallbackNS: 'Common', // 回退命名空间
|
|
85
85
|
backend: {
|
|
86
86
|
loadPath: '/locales/{{lng}}/{{ns}}.json',
|
|
87
87
|
},
|
|
@@ -10,78 +10,78 @@ export const getMenus = () => [
|
|
|
10
10
|
label: t('Home'),
|
|
11
11
|
path: 'Home',
|
|
12
12
|
},
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
13
|
+
// {
|
|
14
|
+
// icon: <TUIIconPark type="peoples" />,
|
|
15
|
+
// menuName: t('SystemManagement', 'Common'),
|
|
16
|
+
// label: t('SystemManagement', 'Common'),
|
|
17
|
+
// key: '/systemManagement',
|
|
18
|
+
// path: 'systemManagement',
|
|
19
|
+
// children: [
|
|
20
|
+
// {
|
|
21
|
+
// menuName: t('AModel'),
|
|
22
|
+
// key: 'modelManage',
|
|
23
|
+
// icon: '',
|
|
24
|
+
// label: t('Model'),
|
|
25
|
+
// path: 'modelManage',
|
|
26
|
+
// },
|
|
27
|
+
// {
|
|
28
|
+
// menuName: t('Evaluation'),
|
|
29
|
+
// key: 'evaluation',
|
|
30
|
+
// icon: '',
|
|
31
|
+
// label: t('Evaluation'),
|
|
32
|
+
// path: 'evaluation',
|
|
33
|
+
// },
|
|
34
|
+
// {
|
|
35
|
+
// icon: '',
|
|
36
|
+
// menuName: t('UserManagement'),
|
|
37
|
+
// label: t('UserManagement'),
|
|
38
|
+
// key: 'userManagement',
|
|
39
|
+
// path: 'userManagement',
|
|
40
|
+
// menuAuth: [{ id: 0, name: '用户管理' }],
|
|
41
|
+
// },
|
|
42
|
+
// {
|
|
43
|
+
// icon: '',
|
|
44
|
+
// menuName: t('BasicManagement'),
|
|
45
|
+
// label: t('BasicManagement'),
|
|
46
|
+
// key: 'basicManagement',
|
|
47
|
+
// path: 'basicManagement',
|
|
48
|
+
// children: [
|
|
49
|
+
// {
|
|
50
|
+
// icon: '',
|
|
51
|
+
// menuName: t('UserGroupManagement'),
|
|
52
|
+
// label: t('UserGroupManagement'),
|
|
53
|
+
// key: 'userGroups',
|
|
54
|
+
// path: 'userGroups',
|
|
55
|
+
// menuAuth: [{ id: 0, name: '用户组管理' }],
|
|
56
|
+
// },
|
|
57
|
+
// {
|
|
58
|
+
// icon: '',
|
|
59
|
+
// menuName: t('RoleManagement'),
|
|
60
|
+
// label: t('RoleManagement'),
|
|
61
|
+
// key: 'roleManagement',
|
|
62
|
+
// path: 'roleManagement',
|
|
63
|
+
// menuAuth: [{ id: 0, name: '角色管理' }],
|
|
64
|
+
// },
|
|
65
|
+
// {
|
|
66
|
+
// icon: '',
|
|
67
|
+
// menuName: t('OperationPermissionManagement'),
|
|
68
|
+
// label: t('OperationPermissionManagement'),
|
|
69
|
+
// key: 'permissionsManagement',
|
|
70
|
+
// path: 'permissionsManagement',
|
|
71
|
+
// menuAuth: [{ id: 0, name: '操作权限管理' }],
|
|
72
|
+
// },
|
|
73
|
+
// {
|
|
74
|
+
// icon: '',
|
|
75
|
+
// menuName: t('OrganizationalStructureManagement'),
|
|
76
|
+
// label: t('OrganizationalStructureManagement'),
|
|
77
|
+
// key: 'organizationManagement',
|
|
78
|
+
// path: 'organizationManagement',
|
|
79
|
+
// menuAuth: [{ id: 0, name: '组织机构管理' }],
|
|
80
|
+
// },
|
|
81
|
+
// ],
|
|
82
|
+
// },
|
|
83
|
+
// ],
|
|
84
|
+
// },
|
|
85
85
|
];
|
|
86
86
|
|
|
87
87
|
/**
|
|
@@ -40,7 +40,7 @@ const defaultConfig = {
|
|
|
40
40
|
interface LoginProps {
|
|
41
41
|
page: 'login' | 'resetPass';
|
|
42
42
|
}
|
|
43
|
-
const TTOSHost = import.meta.env
|
|
43
|
+
const {VITE_REACT_APP_HOST:TTOSHost, VITE_SYSTEM_NAME} = import.meta.env;
|
|
44
44
|
export default function Login({ page = 'login' }: LoginProps) {
|
|
45
45
|
const { message } = App.useApp();
|
|
46
46
|
const navigate = useNavigate();
|
|
@@ -133,7 +133,7 @@ export default function Login({ page = 'login' }: LoginProps) {
|
|
|
133
133
|
|
|
134
134
|
/** 登录页配置项转换 */
|
|
135
135
|
const resultPageConfig = () => ({
|
|
136
|
-
sysTitle:
|
|
136
|
+
sysTitle: VITE_SYSTEM_NAME,
|
|
137
137
|
...pageConfig,
|
|
138
138
|
sysSubTitle: systemSubTitle,
|
|
139
139
|
LoginLogo: logo,
|