
Security News
minimatch Patches 3 High-Severity ReDoS Vulnerabilities
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.
@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
minimatch patched three high-severity ReDoS vulnerabilities that can stall the Node.js event loop, and Socket has released free certified patches.

Research
/Security News
Socket uncovered 26 malicious npm packages tied to North Korea's Contagious Interview campaign, retrieving a live 9-module infostealer and RAT from the adversary's C2.

Research
An impersonated golang.org/x/crypto clone exfiltrates passwords, executes a remote shell stager, and delivers a Rekoobe backdoor on Linux.