Commit 695ec54a authored by xiexiuxing's avatar xiexiuxing

按钮权限组建修复

parent 310401bc
......@@ -23,12 +23,13 @@ const AuthButton = (props: AuthButtonProps) => {
const { pathname } = new URL(window.location.href);
const RoutesAuth = auth.filter((item: any) => item?.u === pathname)
// console.log(pathname, RoutesAuth)
const _authorityBtn = () => {
// 本地开发时传的特殊标识,直接开放权限
if (btnCode === 'DevTest') return true
if (RoutesAuth.length > 0) {
const { b } = RoutesAuth[0];
console.log(RoutesAuth.length, RoutesAuth)
for (let i = 0; i < b.length; i++) {
if (btnCode) {
// 是否有页面标识
......@@ -42,6 +43,6 @@ const AuthButton = (props: AuthButtonProps) => {
return false
}
}
return _authorityBtn ? children : null
return _authorityBtn() ? children : null
}
export default AuthButton;
......@@ -285,7 +285,7 @@ const Materialmanagement = () => {
}
</div>
<div className={styles.Pagination}>
<Pagination total={total} pageSize={from.pageSize} onChange={handlePaginationChange} />
<Pagination total={total} pageSize={from.pageSize} onChange={handlePaginationChange} current={from.current} />
</div>
</Card>
</PageHeaderWrapper >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment