Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
A
admin
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
admin
Commits
d5096d57
提交
d5096d57
authored
10月 16, 2023
作者:
龚洪江
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复:实名认证跳转
上级
e9aa2278
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
53 行增加
和
29 行删除
+53
-29
index.tsx
src/components/layout/title/index.tsx
+30
-5
index.tsx
src/pages/orderManage/equipmentOrder/index.tsx
+0
-8
index.ts
src/router/index.ts
+2
-1
router.tsx
src/router/router.tsx
+0
-12
index.ts
src/store/module/menu/index.ts
+17
-3
isRoute.ts
src/utils/isRoute.ts
+4
-0
没有找到文件。
src/components/layout/title/index.tsx
浏览文件 @
d5096d57
import
{
useEffect
,
useState
}
from
'react'
;
import
{
useEffect
,
useState
}
from
'react'
;
import
{
Header
}
from
'antd/es/layout/layout'
;
import
{
Header
}
from
'antd/es/layout/layout'
;
import
{
DownOutlined
,
Up
Outlined
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
LogoutOutlined
,
UpOutlined
,
Verified
Outlined
}
from
'@ant-design/icons'
;
import
{
Button
,
Dropdown
,
Image
,
M
enuProps
,
M
odal
}
from
'antd'
;
import
{
Button
,
Dropdown
,
Image
,
Modal
}
from
'antd'
;
import
Logo
from
'../../../assets/icon/logo_big.png'
;
import
Logo
from
'../../../assets/icon/logo_big.png'
;
import
'./index.scss'
;
import
'./index.scss'
;
import
{
REMOVE_MENU
,
REMOVE_MENU_ID
,
SET_COLLAPSE
}
from
'~/store/module/menu'
;
import
{
REMOVE_MENU
,
REMOVE_MENU_ID
,
SET_COLLAPSE
,
REMOVE_REQ_MENU
}
from
'~/store/module/menu'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
{
useDispatch
,
useSelector
}
from
'react-redux'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
{
useNavigate
}
from
'react-router-dom'
;
import
Cookies
from
'js-cookie'
;
import
Cookies
from
'js-cookie'
;
import
{
FddInterfaceAPI
}
from
'~/api'
;
import
{
FddInterfaceAPI
}
from
'~/api'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
InterDataType
}
from
'~/api/interface'
;
import
{
userFddInfoType
}
from
'~/api/interface/fddInterfaceType'
;
import
{
userFddInfoType
}
from
'~/api/interface/fddInterfaceType'
;
import
{
decode
}
from
'js-base64'
;
import
{
isRouteById
}
from
'~/utils/isRoute'
;
// fdd实名认证信息类型
// fdd实名认证信息类型
type
fddAuthType
=
InterDataType
<
userFddInfoType
>
;
type
fddAuthType
=
InterDataType
<
userFddInfoType
>
;
...
@@ -29,6 +31,7 @@ export function TitleView() {
...
@@ -29,6 +31,7 @@ export function TitleView() {
// 用户信息
// 用户信息
const
{
userInfo
}
=
useSelector
((
state
:
any
)
=>
state
.
UserInfo
);
const
{
userInfo
}
=
useSelector
((
state
:
any
)
=>
state
.
UserInfo
);
const
{
reqMenuList
}
=
useSelector
((
state
:
any
)
=>
state
.
Menu
);
// 菜单栏收起
// 菜单栏收起
const
setMenuCollapsed
=
()
=>
{
const
setMenuCollapsed
=
()
=>
{
setIsActive
(
!
isActive
);
setIsActive
(
!
isActive
);
...
@@ -42,14 +45,23 @@ export function TitleView() {
...
@@ -42,14 +45,23 @@ export function TitleView() {
}
}
});
});
};
};
// 获取第三方认证连接
const
getCompanyVerifyUrl
=
()
=>
{
FddInterfaceAPI
.
getCompanyVerifyUrl
({
port
:
1
}).
then
(({
result
})
=>
{
if
(
result
)
{
window
.
open
(
decode
(
result
),
'_blank'
);
}
});
};
// 右上角按钮
// 右上角按钮
const
items
:
MenuProps
[
'items'
]
=
[
const
[
items
,
setItems
]
=
useState
<
any
>
(
[
{
{
key
:
'1'
,
key
:
'1'
,
label
:
(
label
:
(
<
Button
<
Button
type=
'link'
type=
'link'
icon=
{
<
LogoutOutlined
/>
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
confirm
({
confirm
({
title
:
'退出登录'
,
title
:
'退出登录'
,
...
@@ -59,6 +71,7 @@ export function TitleView() {
...
@@ -59,6 +71,7 @@ export function TitleView() {
Cookies
.
remove
(
'SHAREFLY-TOKEN'
);
Cookies
.
remove
(
'SHAREFLY-TOKEN'
);
dispatch
(
REMOVE_MENU
());
dispatch
(
REMOVE_MENU
());
dispatch
(
REMOVE_MENU_ID
());
dispatch
(
REMOVE_MENU_ID
());
dispatch
(
REMOVE_REQ_MENU
());
},
},
});
});
}
}
}
}
...
@@ -67,10 +80,22 @@ export function TitleView() {
...
@@ -67,10 +80,22 @@ export function TitleView() {
</
Button
>
</
Button
>
),
),
},
},
];
{
key
:
'2'
,
label
:
(
<
Button
type=
'link'
icon=
{
<
VerifiedOutlined
/>
}
onClick=
{
getCompanyVerifyUrl
}
>
实名认证
</
Button
>
),
},
]);
useEffect
(()
=>
{
useEffect
(()
=>
{
getAppUserFddInfo
();
getAppUserFddInfo
();
if
(
!
isRouteById
(
reqMenuList
,
1450
))
{
items
.
splice
(
1
,
1
);
setItems
([...
items
]);
}
},
[]);
},
[]);
return
(
return
(
<
Header
<
Header
...
...
src/pages/orderManage/equipmentOrder/index.tsx
浏览文件 @
d5096d57
...
@@ -139,14 +139,6 @@ function EquipmentOrderView() {
...
@@ -139,14 +139,6 @@ function EquipmentOrderView() {
setConfirmReturnShow
(
true
);
setConfirmReturnShow
(
true
);
},
},
},
},
{
label
:
'确认归还'
,
status
:
950
,
onClick
:
(
item
:
TableType
[
0
])
=>
{
getRentDetail
(
item
.
id
);
setConfirmReturnShow
(
true
);
},
},
];
];
// 获取当前按钮对象
// 获取当前按钮对象
const
getOperateBtnItem
=
(
code
:
number
)
=>
{
const
getOperateBtnItem
=
(
code
:
number
)
=>
{
...
...
src/router/index.ts
浏览文件 @
d5096d57
...
@@ -4,7 +4,7 @@ import { InterDataType } from '~/api/interface';
...
@@ -4,7 +4,7 @@ import { InterDataType } from '~/api/interface';
import
{
listMenuInfoType
}
from
'~/api/interface/systemManageType'
;
import
{
listMenuInfoType
}
from
'~/api/interface/systemManageType'
;
import
{
SystemManageAPI
}
from
'~/api'
;
import
{
SystemManageAPI
}
from
'~/api'
;
import
{
store
}
from
'~/store'
;
import
{
store
}
from
'~/store'
;
import
{
SET_MENU
}
from
'~/store/module/menu'
;
import
{
SET_MENU
,
SET_REQ_MENU
}
from
'~/store/module/menu'
;
//菜单类型
//菜单类型
type
menuType
=
InterDataType
<
listMenuInfoType
>
;
type
menuType
=
InterDataType
<
listMenuInfoType
>
;
...
@@ -16,6 +16,7 @@ export const authRouterList = async () => {
...
@@ -16,6 +16,7 @@ export const authRouterList = async () => {
const
{
result
}
=
await
SystemManageAPI
.
getListRoleMenuInfo
({
const
{
result
}
=
await
SystemManageAPI
.
getListRoleMenuInfo
({
roleId
:
Number
(
localStorage
.
getItem
(
'roleId'
)),
roleId
:
Number
(
localStorage
.
getItem
(
'roleId'
)),
});
});
store
.
dispatch
(
SET_REQ_MENU
([
result
]));
const
ids
:
number
[]
=
getAllKeys
([
result
]);
const
ids
:
number
[]
=
getAllKeys
([
result
]);
const
getRouteList
=
(
data
:
RouteObjectType
[])
=>
{
const
getRouteList
=
(
data
:
RouteObjectType
[])
=>
{
return
data
.
reduce
((
pre
:
RouteObjectType
[],
cur
)
=>
{
return
data
.
reduce
((
pre
:
RouteObjectType
[],
cur
)
=>
{
...
...
src/router/router.tsx
浏览文件 @
d5096d57
...
@@ -170,7 +170,6 @@ import LimitInfo from '~/pages/systemManage/limitManage/limitInfo';
...
@@ -170,7 +170,6 @@ import LimitInfo from '~/pages/systemManage/limitManage/limitInfo';
import
CustomListDetail
from
'~/pages/customManage/customList/detail'
;
import
CustomListDetail
from
'~/pages/customManage/customList/detail'
;
import
ServiceCategoryDetail
from
'~/pages/categoryManage/serviceCategoryList/detail'
;
import
ServiceCategoryDetail
from
'~/pages/categoryManage/serviceCategoryList/detail'
;
const
AddressManageView
=
React
.
lazy
(()
=>
import
(
'~/pages/systemManage/addressManage'
));
const
AddressManageView
=
React
.
lazy
(()
=>
import
(
'~/pages/systemManage/addressManage'
));
const
RealNameAuthView
=
React
.
lazy
(()
=>
import
(
'~/pages/systemManage/realNameAuth'
));
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
// const IndustryListView = React.lazy(() => import('~/pages/mallManage/industryManage/industryList')); //行业列表
// const IndustryDetailView = React.lazy(
// const IndustryDetailView = React.lazy(
...
@@ -1312,17 +1311,6 @@ export const routerList: Array<RouteObjectType> = [
...
@@ -1312,17 +1311,6 @@ export const routerList: Array<RouteObjectType> = [
icon
:
<
EnvironmentOutlined
/>,
icon
:
<
EnvironmentOutlined
/>,
},
},
},
},
{
path
:
'/systemManage/realNameAuth'
,
element
:
withLoadingComponent
(<
RealNameAuthView
/>),
errorElement
:
<
ErrorPage
/>,
meta
:
{
id
:
1450
,
title
:
'实名认证'
,
icon
:
<
VerifiedOutlined
/>,
develop
:
true
,
},
},
],
],
},
},
];
];
src/store/module/menu/index.ts
浏览文件 @
d5096d57
import
{
createSlice
}
from
'@reduxjs/toolkit'
;
import
{
createSlice
}
from
'@reduxjs/toolkit'
;
const
initialState
=
{
const
initialState
=
{
menuList
:
[],
reqMenuList
:
[],
//请求的菜单
menuList
:
[],
//过滤后的菜单
collapsedActive
:
false
,
collapsedActive
:
false
,
roleId
:
localStorage
.
getItem
(
'roleId'
)
?
Number
(
localStorage
.
getItem
(
'roleId'
))
:
-
1
,
roleId
:
localStorage
.
getItem
(
'roleId'
)
?
Number
(
localStorage
.
getItem
(
'roleId'
))
:
-
1
,
};
};
...
@@ -13,12 +14,18 @@ export const menuSlice = createSlice({
...
@@ -13,12 +14,18 @@ export const menuSlice = createSlice({
SET_MENU
(
state
,
action
)
{
SET_MENU
(
state
,
action
)
{
state
.
menuList
=
action
.
payload
;
state
.
menuList
=
action
.
payload
;
},
},
SET_REQ_MENU
(
state
,
action
)
{
state
.
reqMenuList
=
action
.
payload
;
},
SET_COLLAPSE
(
state
,
action
)
{
SET_COLLAPSE
(
state
,
action
)
{
state
.
collapsedActive
=
action
.
payload
;
state
.
collapsedActive
=
action
.
payload
;
},
},
REMOVE_MENU
(
state
)
{
REMOVE_MENU
(
state
)
{
state
.
menuList
=
[];
state
.
menuList
=
[];
},
},
REMOVE_REQ_MENU
(
state
)
{
state
.
reqMenuList
=
[];
},
SET_MENU_ID
(
state
,
action
)
{
SET_MENU_ID
(
state
,
action
)
{
state
.
roleId
=
action
.
payload
;
state
.
roleId
=
action
.
payload
;
localStorage
.
setItem
(
'roleId'
,
action
.
payload
);
localStorage
.
setItem
(
'roleId'
,
action
.
payload
);
...
@@ -29,7 +36,14 @@ export const menuSlice = createSlice({
...
@@ -29,7 +36,14 @@ export const menuSlice = createSlice({
},
},
});
});
export
const
{
SET_MENU
,
SET_COLLAPSE
,
REMOVE_MENU
,
SET_MENU_ID
,
REMOVE_MENU_ID
}
=
export
const
{
menuSlice
.
actions
;
SET_MENU
,
SET_COLLAPSE
,
REMOVE_MENU
,
SET_MENU_ID
,
REMOVE_MENU_ID
,
REMOVE_REQ_MENU
,
SET_REQ_MENU
,
}
=
menuSlice
.
actions
;
export
const
Menu
=
menuSlice
.
reducer
;
export
const
Menu
=
menuSlice
.
reducer
;
src/utils/isRoute.ts
浏览文件 @
d5096d57
...
@@ -24,3 +24,7 @@ export const isRoute = (list: any, pathname: string) => {
...
@@ -24,3 +24,7 @@ export const isRoute = (list: any, pathname: string) => {
(
v
.
children
&&
isRoute
(
v
.
children
,
pathname
)),
(
v
.
children
&&
isRoute
(
v
.
children
,
pathname
)),
);
);
};
};
export
const
isRouteById
=
(
list
:
any
,
id
:
number
)
=>
{
return
list
.
some
((
v
:
any
)
=>
v
.
id
===
id
||
(
v
.
children
&&
isRouteById
(
v
.
children
,
id
)));
};
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论