张涛 1 年之前
父節點
當前提交
d037d6cfc2

+ 45
- 36
src/layouts/AuthLayout/components/Header/User.jsx 查看文件

1
-import React, { useState, forwardRef, useRef, useImperativeHandle } from 'react'
2
-import { Avatar, Dropdown } from 'antd'
1
+import React, {
2
+  useState,
3
+  forwardRef,
4
+  useRef,
5
+  useImperativeHandle,
6
+} from "react";
7
+import { Avatar, Dropdown } from "antd";
3
 import {
8
 import {
4
   ModalForm,
9
   ModalForm,
5
   ProFormText,
10
   ProFormText,
6
   ProFormDependency,
11
   ProFormDependency,
7
-} from '@ant-design/pro-components'
8
-import md5 from 'md5'
9
-import { changePassword } from '@/services/login'
12
+} from "@ant-design/pro-components";
13
+import md5 from "md5";
14
+import { changePassword } from "@/services/login";
15
+import { useNavigate } from "react-router-dom";
10
 
16
 
11
-const DefaultAvatar = ({ color = '#1296db' }) => (
17
+const DefaultAvatar = ({ color = "#1296db" }) => (
12
   <svg
18
   <svg
13
     viewBox="0 0 1024 1024"
19
     viewBox="0 0 1024 1024"
14
     version="1.1"
20
     version="1.1"
21
       fill={color}
27
       fill={color}
22
     ></path>
28
     ></path>
23
   </svg>
29
   </svg>
24
-)
30
+);
25
 
31
 
26
 const ChangePassword = forwardRef((props, ref) => {
32
 const ChangePassword = forwardRef((props, ref) => {
27
-  const { user } = props
33
+  const { user } = props;
34
+  const navigate = useNavigate();
28
 
35
 
29
-  const [visible, setVisible] = useState(false)
36
+  const [visible, setVisible] = useState(false);
30
 
37
 
31
   const onFinish = async (values) => {
38
   const onFinish = async (values) => {
32
-    console.log('values', values);
39
+    console.log("values", values);
33
     const data = {
40
     const data = {
34
       // originPassword: values.password,
41
       // originPassword: values.password,
35
       // newPassword: values.newPassword,
42
       // newPassword: values.newPassword,
36
       originPassword: md5(values.password),
43
       originPassword: md5(values.password),
37
       newPassword: md5(values.newPassword),
44
       newPassword: md5(values.newPassword),
38
-    }
39
-    await changePassword(data)
40
-
41
-    return true
42
-  }
45
+    };
46
+    await changePassword(data);
47
+    const tenantId = localStorage.getItem("tenantId");
48
+    navigate(`/login?id=${tenantId}`);
49
+    localStorage.removeItem("token");
50
+    return true;
51
+  };
43
 
52
 
44
   useImperativeHandle(ref, () => {
53
   useImperativeHandle(ref, () => {
45
     return {
54
     return {
46
       show: () => setVisible(true),
55
       show: () => setVisible(true),
47
-    }
48
-  })
56
+    };
57
+  });
49
 
58
 
50
   return (
59
   return (
51
     <ModalForm
60
     <ModalForm
58
       <ProFormText.Password
67
       <ProFormText.Password
59
         label="原始密码"
68
         label="原始密码"
60
         name="password"
69
         name="password"
61
-        rules={[{ required: true, message: '请输入原始密码!' }]}
70
+        rules={[{ required: true, message: "请输入原始密码!" }]}
62
       />
71
       />
63
       <ProFormText.Password
72
       <ProFormText.Password
64
         label="新密码"
73
         label="新密码"
65
         name="newPassword"
74
         name="newPassword"
66
-        rules={[{ required: true, message: '请输入新密码!' }]}
75
+        rules={[{ required: true, message: "请输入新密码!" }]}
67
       />
76
       />
68
 
77
 
69
-      <ProFormDependency name={['newPassword']}>
78
+      <ProFormDependency name={["newPassword"]}>
70
         {({ newPassword }) => (
79
         {({ newPassword }) => (
71
           <ProFormText.Password
80
           <ProFormText.Password
72
             label="确认新密码"
81
             label="确认新密码"
73
             name="newPassword2"
82
             name="newPassword2"
74
             rules={[
83
             rules={[
75
-              { required: true, message: '请输入新密码!' },
84
+              { required: true, message: "请输入新密码!" },
76
               () => ({
85
               () => ({
77
-                validator (_, value) {
86
+                validator(_, value) {
78
                   if (!value || value == newPassword) {
87
                   if (!value || value == newPassword) {
79
-                    return Promise.resolve()
88
+                    return Promise.resolve();
80
                   }
89
                   }
81
 
90
 
82
-                  return Promise.reject('两次输入密码不一致')
91
+                  return Promise.reject("两次输入密码不一致");
83
                 },
92
                 },
84
               }),
93
               }),
85
             ]}
94
             ]}
87
         )}
96
         )}
88
       </ProFormDependency>
97
       </ProFormDependency>
89
     </ModalForm>
98
     </ModalForm>
90
-  )
91
-})
99
+  );
100
+});
92
 
101
 
93
 export default (props) => {
102
 export default (props) => {
94
   const items = [
103
   const items = [
95
     {
104
     {
96
-      key: 'changePassword',
97
-      label: '修改密码',
105
+      key: "changePassword",
106
+      label: "修改密码",
98
     },
107
     },
99
-  ]
108
+  ];
100
 
109
 
101
-  const passRef = useRef()
102
-  const { user = {} } = props
110
+  const passRef = useRef();
111
+  const { user = {} } = props;
103
   const onClick = ({ key }) => {
112
   const onClick = ({ key }) => {
104
-    if (key === 'changePassword') {
105
-      passRef.current.show()
113
+    if (key === "changePassword") {
114
+      passRef.current.show();
106
     }
115
     }
107
-  }
116
+  };
108
   return (
117
   return (
109
     <Dropdown menu={{ items, onClick }}>
118
     <Dropdown menu={{ items, onClick }}>
110
       <div className="user-info">
119
       <div className="user-info">
113
         <ChangePassword user={user} ref={passRef} />
122
         <ChangePassword user={user} ref={passRef} />
114
       </div>
123
       </div>
115
     </Dropdown>
124
     </Dropdown>
116
-  )
117
-}
125
+  );
126
+};

+ 9
- 7
src/layouts/AuthLayout/components/Menus.jsx 查看文件

1
-import React from 'react'
2
-import { Menu } from 'antd'
1
+import React from "react";
2
+import { Menu } from "antd";
3
 
3
 
4
-const menuStyle = { height: '100%' }
4
+const menuStyle = { height: "100%" };
5
 
5
 
6
 export default (props) => {
6
 export default (props) => {
7
-  const { theme, items, location } = props
7
+  const { theme, items, location } = props;
8
 
8
 
9
   // const selectedKeys = React.useMemo(() => {
9
   // const selectedKeys = React.useMemo(() => {
10
   //   const parts = location.pathname.split('/').filter(Boolean);
10
   //   const parts = location.pathname.split('/').filter(Boolean);
17
 
17
 
18
   //   return keys;
18
   //   return keys;
19
   // }, [location.pathname]);
19
   // }, [location.pathname]);
20
-  const selectedKeys = [location.pathname]
20
+  const selectedKeys = [location.pathname];
21
+
22
+
21
   return (
23
   return (
22
     <Menu
24
     <Menu
23
       mode="inline"
25
       mode="inline"
26
       items={items}
28
       items={items}
27
       selectedKeys={selectedKeys}
29
       selectedKeys={selectedKeys}
28
     />
30
     />
29
-  )
30
-}
31
+  );
32
+};

+ 15
- 11
src/layouts/AuthLayout/components/SiderBar.jsx 查看文件

1
-import React, { useMemo } from 'react'
2
-import { Layout, Spin } from 'antd'
3
-import { getPropertyValue } from '@/utils/css'
4
-import Menus from './Menus'
1
+import React, { useMemo } from "react";
2
+import { Layout, Spin } from "antd";
3
+import { getPropertyValue } from "@/utils/css";
4
+import Menus from "./Menus";
5
 
5
 
6
-const { Sider } = Layout
6
+const { Sider } = Layout;
7
 
7
 
8
 export default (props) => {
8
 export default (props) => {
9
-  const { theme, location, menus } = props
9
+  const { theme, location, menus } = props;
10
 
10
 
11
   const width = useMemo(() => {
11
   const width = useMemo(() => {
12
-    return /\d+/.exec(getPropertyValue('--siderbar-width'))[0] - 0
13
-  }, [])
12
+    return /\d+/.exec(getPropertyValue("--siderbar-width"))[0] - 0;
13
+  }, []);
14
+
15
+  // console.log(theme);
16
+  // console.log(menus);
17
+  // console.log(location);
14
 
18
 
15
   return (
19
   return (
16
-    <Sider className="layout-sidebar" theme={theme}  collapsible width={width}>
20
+    <Sider className="layout-sidebar" theme={theme} collapsible width={width}>
17
       <Menus theme={theme} items={menus} location={location} />
21
       <Menus theme={theme} items={menus} location={location} />
18
     </Sider>
22
     </Sider>
19
-  )
20
-}
23
+  );
24
+};

+ 112
- 110
src/routes/routes.jsx 查看文件

11
   PayCircleOutlined,
11
   PayCircleOutlined,
12
   TabletOutlined,
12
   TabletOutlined,
13
   HddOutlined,
13
   HddOutlined,
14
-  WalletOutlined
15
-} from '@ant-design/icons'
16
-import { Outlet, Navigate } from 'react-router-dom'
17
-import AuthLayout from '@/layouts/AuthLayout'
18
-import Login from '@/pages/login'
19
-import Page404 from '@/pages/404'
20
-import AdUser from '@/pages/adUser'
21
-import AdUserEdit from '@/pages/adUser/Edit'
22
-import Project from '@/pages/project'
23
-import ProjectEdit from '@/pages/project/Edit'
24
-import ProjectContact from '@/pages/projectContact'
25
-import ProjectContactEdit from '@/pages/projectContact/Edit'
26
-import ProjectDeploy from '@/pages/projectDeploy'
27
-import ProjectDeployEdit from '@/pages/project/components/ProjectDeployEdit'
28
-import ProjectNode from '@/pages/projectNode'
14
+  WalletOutlined,
15
+  BorderInnerOutlined,
16
+  HeatMapOutlined,
17
+  MediumOutlined,
18
+} from "@ant-design/icons";
19
+import { Outlet, Navigate } from "react-router-dom";
20
+import AuthLayout from "@/layouts/AuthLayout";
21
+import Login from "@/pages/login";
22
+import Page404 from "@/pages/404";
23
+import AdUser from "@/pages/adUser";
24
+import AdUserEdit from "@/pages/adUser/Edit";
25
+import Project from "@/pages/project";
26
+import ProjectEdit from "@/pages/project/Edit";
27
+import ProjectContact from "@/pages/projectContact";
28
+import ProjectContactEdit from "@/pages/projectContact/Edit";
29
+import ProjectDeploy from "@/pages/projectDeploy";
30
+import ProjectDeployEdit from "@/pages/project/components/ProjectDeployEdit";
31
+import ProjectNode from "@/pages/projectNode";
29
 
32
 
30
-import Role from '@/pages/role'
31
-import Dept from '@/pages/dept'
32
-import Package from '@/pages/package'
33
-import PackageEdit from '@/pages/package/Edit'
34
-import Member from '@/pages/member'
35
-import MemberEdit from '@/pages/member/Edit'
36
-import Custom from '@/pages/custom'
37
-import CustomEdit from '@/pages/custom/Edit'
38
-import Finance from '@/pages/finance'
39
-import FinanceEdit from '@/pages/finance/Edit'
40
-import FinanceItem from '@/pages/financeItem'
41
-import FinanceItemEdit from '@/pages/financeItem/Edit'
42
-import Tenant from '@/pages/tenant'
43
-import TenantEdit from '@/pages/tenant/Edit'
33
+import Role from "@/pages/role";
34
+import Dept from "@/pages/dept";
35
+import Package from "@/pages/package";
36
+import PackageEdit from "@/pages/package/Edit";
37
+import Member from "@/pages/member";
38
+import MemberEdit from "@/pages/member/Edit";
39
+import Custom from "@/pages/custom";
40
+import CustomEdit from "@/pages/custom/Edit";
41
+import Finance from "@/pages/finance";
42
+import FinanceEdit from "@/pages/finance/Edit";
43
+import FinanceItem from "@/pages/financeItem";
44
+import FinanceItemEdit from "@/pages/financeItem/Edit";
45
+import Tenant from "@/pages/tenant";
46
+import TenantEdit from "@/pages/tenant/Edit";
44
 
47
 
45
 // import RoleEdit from "@/pages/role/Edit";
48
 // import RoleEdit from "@/pages/role/Edit";
46
 /**
49
 /**
62
     element: <Navigate to="/aduser" replace={true} />,
65
     element: <Navigate to="/aduser" replace={true} />,
63
   },
66
   },
64
   {
67
   {
65
-    path: '/custom',
68
+    path: "/custom",
66
     element: <Outlet />,
69
     element: <Outlet />,
67
     meta: {
70
     meta: {
68
-      title: '客户管理',
69
-      menuType: 'group',
71
+      title: "客户管理",
72
+      menuType: "group",
73
+      icon: <HeatMapOutlined />,
70
     },
74
     },
71
     children: [
75
     children: [
72
       {
76
       {
73
-        path: 'aduser',
77
+        path: "aduser",
74
         element: <AdUser />,
78
         element: <AdUser />,
75
         meta: {
79
         meta: {
76
-          title: '用户管理',
80
+          title: "用户管理",
77
           icon: <SolutionOutlined />,
81
           icon: <SolutionOutlined />,
78
         },
82
         },
79
       },
83
       },
80
       {
84
       {
81
-        path: 'aduser/edit',
85
+        path: "aduser/edit",
82
         element: <AdUserEdit />,
86
         element: <AdUserEdit />,
83
         meta: {
87
         meta: {
84
-          title: '用户维护',
88
+          title: "用户维护",
85
           hideInMenu: true,
89
           hideInMenu: true,
86
         },
90
         },
87
       },
91
       },
88
       {
92
       {
89
-        path: 'dept',
93
+        path: "dept",
90
         element: <Dept />,
94
         element: <Dept />,
91
         meta: {
95
         meta: {
92
-          title: '部门管理',
96
+          title: "部门管理",
93
           icon: <TabletOutlined />,
97
           icon: <TabletOutlined />,
94
         },
98
         },
95
       },
99
       },
96
       {
100
       {
97
-        path: 'tenant/edit',
101
+        path: "tenant/edit",
98
         element: <TenantEdit />,
102
         element: <TenantEdit />,
99
         meta: {
103
         meta: {
100
-          title: '租户编辑',
104
+          title: "租户编辑",
101
           hideInMenu: true,
105
           hideInMenu: true,
102
         },
106
         },
103
       },
107
       },
104
       {
108
       {
105
-        path: 'role',
109
+        path: "role",
106
         element: <Role />,
110
         element: <Role />,
107
         meta: {
111
         meta: {
108
-          title: '角色管理',
112
+          title: "角色管理",
109
           icon: <UserOutlined />,
113
           icon: <UserOutlined />,
110
         },
114
         },
111
       },
115
       },
112
 
116
 
113
       {
117
       {
114
-        path: 'package',
118
+        path: "package",
115
         element: <Package />,
119
         element: <Package />,
116
         meta: {
120
         meta: {
117
-          title: '套餐管理',
121
+          title: "套餐管理",
118
           icon: <HddOutlined />,
122
           icon: <HddOutlined />,
119
         },
123
         },
120
       },
124
       },
121
       {
125
       {
122
-        path: 'package/edit',
126
+        path: "package/edit",
123
         element: <PackageEdit />,
127
         element: <PackageEdit />,
124
         meta: {
128
         meta: {
125
-          title: '套餐维护',
129
+          title: "套餐维护",
126
           hideInMenu: true,
130
           hideInMenu: true,
127
         },
131
         },
128
       },
132
       },
129
       {
133
       {
130
-        path: 'member',
134
+        path: "member",
131
         element: <Member />,
135
         element: <Member />,
132
         meta: {
136
         meta: {
133
-          title: '会员管理',
137
+          title: "会员管理",
134
           icon: <WalletOutlined />,
138
           icon: <WalletOutlined />,
135
         },
139
         },
136
       },
140
       },
137
       {
141
       {
138
-        path: 'member/edit',
142
+        path: "member/edit",
139
         element: <MemberEdit />,
143
         element: <MemberEdit />,
140
         meta: {
144
         meta: {
141
-          title: '会员详情',
145
+          title: "会员详情",
142
           hideInMenu: true,
146
           hideInMenu: true,
143
         },
147
         },
144
-      }
145
-    ]
148
+      },
149
+    ],
146
   },
150
   },
147
   {
151
   {
148
-    path: '/project',
152
+    path: "/project",
149
     element: <Outlet />,
153
     element: <Outlet />,
150
     meta: {
154
     meta: {
151
-      title: '项目管理',
152
-      menuType: 'group',
155
+      title: "项目管理",
156
+      menuType: "group",
157
+      icon: <BorderInnerOutlined />,
153
     },
158
     },
154
     children: [
159
     children: [
155
       {
160
       {
156
-        path: 'project',
161
+        path: "project",
157
         element: <Project />,
162
         element: <Project />,
158
         meta: {
163
         meta: {
159
-          title: '项目管理',
164
+          title: "项目管理",
160
           icon: <FileTextOutlined />,
165
           icon: <FileTextOutlined />,
161
         },
166
         },
162
       },
167
       },
163
       {
168
       {
164
-        path: 'project/edit',
169
+        path: "project/edit",
165
         element: <ProjectEdit />,
170
         element: <ProjectEdit />,
166
         meta: {
171
         meta: {
167
-          title: '项目维护',
172
+          title: "项目维护",
168
           hideInMenu: true,
173
           hideInMenu: true,
169
         },
174
         },
170
       },
175
       },
171
       {
176
       {
172
-        path: 'projectDeploy/edit',
177
+        path: "projectDeploy/edit",
173
         element: <ProjectDeployEdit />,
178
         element: <ProjectDeployEdit />,
174
         meta: {
179
         meta: {
175
-          title: '部署维护',
180
+          title: "部署维护",
176
           hideInMenu: true,
181
           hideInMenu: true,
177
         },
182
         },
178
       },
183
       },
179
       {
184
       {
180
-        path: 'projectContact',
185
+        path: "projectContact",
181
         element: <ProjectContact />,
186
         element: <ProjectContact />,
182
         meta: {
187
         meta: {
183
-          title: '项目联系人管理',
188
+          title: "项目联系人管理",
184
           icon: <UserAddOutlined />,
189
           icon: <UserAddOutlined />,
185
         },
190
         },
186
       },
191
       },
187
       {
192
       {
188
-        path: 'projectContact/edit',
193
+        path: "projectContact/edit",
189
         element: <ProjectContactEdit />,
194
         element: <ProjectContactEdit />,
190
         meta: {
195
         meta: {
191
-          title: '项目联系人维护',
196
+          title: "项目联系人维护",
192
           hideInMenu: true,
197
           hideInMenu: true,
193
         },
198
         },
194
       },
199
       },
195
 
200
 
196
       {
201
       {
197
-        path: 'custom',
202
+        path: "custom",
198
         element: <Custom />,
203
         element: <Custom />,
199
         meta: {
204
         meta: {
200
-          title: '客户管理',
205
+          title: "客户管理",
201
           icon: <UsergroupAddOutlined />,
206
           icon: <UsergroupAddOutlined />,
202
         },
207
         },
203
       },
208
       },
204
       {
209
       {
205
-        path: 'custom/edit',
210
+        path: "custom/edit",
206
         element: <CustomEdit />,
211
         element: <CustomEdit />,
207
         meta: {
212
         meta: {
208
-          title: '客户维护',
213
+          title: "客户维护",
209
           hideInMenu: true,
214
           hideInMenu: true,
210
         },
215
         },
211
       },
216
       },
212
-    ]
217
+    ],
213
   },
218
   },
214
   {
219
   {
215
-    path: '/finance',
220
+    path: "/finance",
216
     element: <Outlet />,
221
     element: <Outlet />,
217
     meta: {
222
     meta: {
218
-      title: '财务管理',
219
-      menuType: 'group',
223
+      title: "财务管理",
224
+      menuType: "group",
225
+      icon: <MediumOutlined />,
220
     },
226
     },
221
     children: [
227
     children: [
222
-      ,
223
       {
228
       {
224
-        path: 'finance',
229
+        path: "finance",
225
         element: <Finance />,
230
         element: <Finance />,
226
         meta: {
231
         meta: {
227
-          title: '公司财务管理',
232
+          title: "公司财务管理",
228
           icon: <TransactionOutlined />,
233
           icon: <TransactionOutlined />,
229
         },
234
         },
230
       },
235
       },
231
       {
236
       {
232
-        path: 'finance/edit',
237
+        path: "finance/edit",
233
         element: <FinanceEdit />,
238
         element: <FinanceEdit />,
234
         meta: {
239
         meta: {
235
-          title: '财务维护',
240
+          title: "财务维护",
236
           hideInMenu: true,
241
           hideInMenu: true,
237
         },
242
         },
238
       },
243
       },
239
       {
244
       {
240
-        path: 'financeItem',
245
+        path: "financeItem",
241
         element: <FinanceItem />,
246
         element: <FinanceItem />,
242
         meta: {
247
         meta: {
243
-          title: '收付款管理',
248
+          title: "收付款管理",
244
           icon: <PayCircleOutlined />,
249
           icon: <PayCircleOutlined />,
245
         },
250
         },
246
       },
251
       },
247
       {
252
       {
248
-        path: 'financeItem/edit',
253
+        path: "financeItem/edit",
249
         element: <FinanceItemEdit />,
254
         element: <FinanceItemEdit />,
250
         meta: {
255
         meta: {
251
-          title: '收付款维护',
256
+          title: "收付款维护",
252
           hideInMenu: true,
257
           hideInMenu: true,
253
         },
258
         },
254
       },
259
       },
255
-    ]
260
+    ],
256
   },
261
   },
257
 
262
 
258
-
259
-
260
   // {
263
   // {
261
   //   path: 'projectDeploy',
264
   //   path: 'projectDeploy',
262
   //   element: <ProjectDeploy />,
265
   //   element: <ProjectDeploy />,
282
   //     icon: <UserOutlined />,
285
   //     icon: <UserOutlined />,
283
   //   },
286
   //   },
284
   // },
287
   // },
285
-
286
-]
288
+];
287
 
289
 
288
 export const defaultRoutes = [
290
 export const defaultRoutes = [
289
   {
291
   {
290
-    path: '/',
292
+    path: "/",
291
     element: <AuthLayout />,
293
     element: <AuthLayout />,
292
     children: [
294
     children: [
293
       {
295
       {
294
-        path: '*',
296
+        path: "*",
295
         element: <Page404 />,
297
         element: <Page404 />,
296
       },
298
       },
297
     ],
299
     ],
298
   },
300
   },
299
   {
301
   {
300
-    path: '/login',
302
+    path: "/login",
301
     element: <Login />,
303
     element: <Login />,
302
   },
304
   },
303
   {
305
   {
304
-    path: '*',
306
+    path: "*",
305
     element: <Page404 />,
307
     element: <Page404 />,
306
   },
308
   },
307
-]
309
+];
308
 
310
 
309
-export function mergeAuthRoutes (r1, r2) {
310
-  const r = r1.slice()
311
-  const children = r1[0].children.slice()
312
-  r[0].children = children.concat(r2)
313
-  return r
311
+export function mergeAuthRoutes(r1, r2) {
312
+  const r = r1.slice();
313
+  const children = r1[0].children.slice();
314
+  r[0].children = children.concat(r2);
315
+  return r;
314
 }
316
 }
315
 
317
 
316
 // 全部路由
318
 // 全部路由
317
-export const routes = mergeAuthRoutes(defaultRoutes, authRoutes)
318
-function getPath (parent = '/', current = '') {
319
-  if (current.indexOf('/') === 0 || current.indexOf('http') === 0)
320
-    return current
321
-  return `${parent}/${current}`.replace(/\/\//g, '/')
319
+export const routes = mergeAuthRoutes(defaultRoutes, authRoutes);
320
+function getPath(parent = "/", current = "") {
321
+  if (current.indexOf("/") === 0 || current.indexOf("http") === 0)
322
+    return current;
323
+  return `${parent}/${current}`.replace(/\/\//g, "/");
322
 }
324
 }
323
 
325
 
324
 // 路由数组, 一维数组
326
 // 路由数组, 一维数组
325
 export const routeArr = (() => {
327
 export const routeArr = (() => {
326
-  const flatten = (routes, parentPath = '/') => {
328
+  const flatten = (routes, parentPath = "/") => {
327
     return routes.reduce((acc, route) => {
329
     return routes.reduce((acc, route) => {
328
-      const path = getPath(parentPath, route.path)
329
-      const children = route.children ? flatten(route.children, path) : []
330
+      const path = getPath(parentPath, route.path);
331
+      const children = route.children ? flatten(route.children, path) : [];
330
 
332
 
331
-      return acc.concat([{ ...route, path }].concat(children))
332
-    }, [])
333
-  }
333
+      return acc.concat([{ ...route, path }].concat(children));
334
+    }, []);
335
+  };
334
 
336
 
335
-  return flatten(routes)
336
-})()
337
+  return flatten(routes);
338
+})();