Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@antdp/config
Advanced tools
我们已将 umi 配置包裹了一层, 如果需要antdp中能使用自定义配置,你可以使用项目根目录的 config/config.ts
/config/config.js
进行配置
npm i @antdp/config --save-dev
// config/config.{js|ts}
//二次封装的umi配置
import config from '@antdp/config';
// 路由数据
import router from './router.json';
/**开发代理配置*/
import proxy from './proxy';
export default config(router, {
proxy,
});
import { IConfig, IRoute } from '@umijs/max';
export interface Options extends Omit<IConfig, 'routes'> {
routes: IRoute;
}
export interface Config {
(routes?: IRoute, optiosn?: Options): IConfig;
}
declare var config: Config;
export default config;
是否显示 Tab 选项卡,默认值true
显示
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {
+ ANTD_IS_TABS: true
},
);
是否使用 iframe 展示内容,默认值true
开启
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {
+ ANTD_IS_IFRAME_RENDER: true
},
);
是否展示面包屑, Tab 选项卡优先级大于面包屑
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {
+ ANTD_IS_BREADCRUMB: true
},
);
是否开启权限验证 默认值false
不启用
auth_menu
储存菜单路由权限---本地keys 默认值authMenu
auth_btn
储存按钮路径权限---本地keys 默认值 authBtn
auth_check_url
判断路径是否有权限的字段 默认值menuUrl
,如果字段设置为undefined
则auth_menu
和auth_btn
储存形式为 ["/web"]
,反之储存形式为[{menuUrl:"/web"}]
,import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {
+ ANTD_AUTH_CONF: {
+ auth_menu:"authMenu",
+ auth_btn:"authBtn",
+ auth_check_url:undefined
}
},
);
是否显示 左侧菜单,默认值true
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {
+ ANTD_MENU_IS_SHOW: true
},
);
是否显示 head头部,默认值true
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {
+ ANTD_HEAD_IS_SHOW: true
},
);
是否开启菜单栏搜索,默认值false
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {
+ ANTD_MENU_SEARCH_IS_SHOW: true
},
);
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {},
locale: {
// 默认使用 src/locales/zh-CN.ts 作为多语言文件
+ default: 'zh-CN',
+ antd: true,
// default true, when it is true, will use `navigator.language` overwrite default
// baseNavigator: true,
/**
* [国际化] 控制台提示 Warning: The current popular language does not exist, please check the locales folder! 警告信息
* https://github.com/umijs/umi/issues/4363#issuecomment-616134434
* 警用 `baseNavigator` 和 `title` 两个配置项 可以解决国际化警告问题
*/
+ baseNavigator: false,
+ title: false,
},
},
);
开启 useRequest
和 request
,默认未开启
dataField
该配置的默认值是 data。该配置的主要目的是方便 useRequest 直接消费数据。如果你想要在消费数据时拿到后端的原始数据,需要在这里配置 dataField
为 ''import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {},
+ request:{}
);
开启react-query
,默认未开启
devtool
: boolean,是否开启 react query 官方 devtool 工具,默认 true
queryClient
: boolean, 是否注册全局的 QueryClient 和 QueryClientProvier,默认 true
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {},
+ reactQuery: {
// 是否开启 react query 官方 devtool 工具
+ devtool: false,
+ queryClient: true,
},
);
开启useModel
,默认未开启
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {},
+ model: {},
);
开启dva
,默认未开启
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {},
+ dva: {},
);
styled-components 样式方案
babelPlugin
: Object,开启 styled-components 的 babel 插件,仅 dev 模式有效
比如:import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {},
+ styledComponents: {},
);
valtio
数据流方案
import config from '@antdp/config';
import proxy from './proxy';
import router from './router.json';
export default config(router, {
proxy,
define: {},
+ valtio: {},
);
FAQs
The npm package @antdp/config receives a total of 67 weekly downloads. As such, @antdp/config popularity was classified as not popular.
We found that @antdp/config demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.