
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
@antdp/authorized
Advanced tools
通过判断是否进入主界面还是登录界面。
npm i @antdp/authorized --save
import React from 'react';
import BasicLayout from '@antdp/basic-layouts';
import UserLogin from '@antdp/user-login';
import Authorized from '@antdp/authorized';
// 入口页面
const UserLayout = (props) => {
return (
<Authorized authority={!props.token} redirectPath="/login">
<UserLogin />
</Authorized>
)
};
// 登录页面
const Layout = (props) => {
return (
<Authorized authority={!props.token} redirectPath="/">
<BasicLayout />
</Authorized>
)
};
interface AuthorizedProps {
/**
* 准入权限/权限判断
*/
authority?: boolean;
/**
* 权限异常时重定向的页面路由
*/
redirectPath?: string;
children?: React.ReactNode;
}
/**
* @description: 页面权限
* @param {Array} menuRouter 原始 routes.json 文件中路由
* @param {string} path 当前路径
* @return {*}
*/
type GetAuthorizedPageProps = (menuRouter: Array<any>, path: string) => boolean
// 按钮权限
interface AuthorizedBtnProps {
// 权限路径
path?: string,
// 展示内容
children?: React.ReactNode
}
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.