AlainConfig
核心配置对象。
一个配置对象 AlainConfig, 它有一个默认的
一个配置服务:AlainConfigService
https://github.com/ng-alain/delon/blob/master/packages/util/config/config.types.ts
export interface AlainConfig {
dataRange?: AlainDateRangePickerConfig;
exception?: AlainExceptionType;
errorCollect?: AlainErrorCollectConfig;
image?: AlainImageConfig;
loading?: AlainLoadingConfig;
onboarding?: AlainOnboardingConfig;
lodop?: AlainLodopConfig;
pageHeader?: AlainPageHeaderConfig;
qr?: AlainQRConfig;
se?: AlainSEConfig;
sg?: AlainSGConfig;
sv?: AlainSVConfig;
st?: AlainSTConfig;
sf?: AlainSFConfig;
xlsx?: AlainXlsxConfig;
zip?: AlainZipConfig;
pdf?: AlainPdfConfig;
media?: AlainMediaConfig;
acl?: AlainACLConfig;
auth?: AlainAuthConfig;
cache?: AlainCacheConfig;
chart?: AlainChartConfig;
mock?: AlainMockConfig;
utilArray?: AlainUtilArrayConfig;
utilCurrency?: AlainUtilCurrencyConfig;
themeHttp?: AlainThemeHttpClientConfig;
themeResponsive?: AlainThemeResponsiveConfig;
themeI18n?: AlainThemeI18nConfig;
}
export const ALAIN_CONFIG = new InjectionToken<AlainConfig>('alain-config', {
providedIn: 'root',
factory: ALAIN_CONFIG_FACTORY
});
export function ALAIN_CONFIG_FACTORY(): AlainConfig {
return {};
}
定义了返回配置的 Token: ALAIN_CONFIG
还有一个返回配置信息的工厂 ALAIN_CONFIG_FACTORY
其中 AlainAuthConfig 的默认值见:https://github.com/ng-alain/delon/blob/master/packages/auth/src/auth.config.ts
import type { AlainAuthConfig, AlainConfigService } from '@delon/util/config';
export const AUTH_DEFAULT_CONFIG: AlainAuthConfig = {
store_key: `_token`,
token_invalid_redirect: true,
token_exp_offset: 10,
token_send_key: `token`,
token_send_template: '${token}',
token_send_place: 'header',
login_url: '/login',
ignores: [/\/login/, /assets\//, /passport\//],
allow_anonymous_key: `_allow_anonymous`,
executeOtherInterceptors: true,
refreshTime: 3000,
refreshOffset: 6000
};
export function mergeConfig(srv: AlainConfigService): AlainAuthConfig {
return srv.merge('auth', AUTH_DEFAULT_CONFIG)!;
}
随机推荐
- SuperMap iManager云套件数据动态更新刷新地图与数据服务
一.使用背景 有这么一个需求,后端也就通过SuperMap iDesktop或数据库更新了新增或更新某个数据地理信息后,云套件SuperMap iManager中的服务没有更新,无法实时查看到更新的数 ...
- Python 潮流周刊#71:PyPI 应该摆脱掉它的赞助依赖(摘要)
本周刊由 Python猫 出品,精心筛选国内外的 250+ 信息源,为你挑选最值得分享的文章.教程.开源项目.软件工具.播客和视频.热门话题等内容.愿景:帮助所有读者精进 Python 技术,并增长职 ...
- CentOS 7.9安装ElasticSearch7.14.0、ElasticSearch-Head、Kibana、Node14.18.2
CentOS 7.9安装ElasticSearch7.14.0.ElasticSearch-Head.Kibana.Node14.18.2 1.安装文件 1. elasticsearch-7.14 ...
- const` 关键字位于函数签名的末尾
在 C++ 中,const 关键字可以应用于成员函数,表示该函数不会修改对象的成员变量. const 出现在 operator->() 成员函数的末尾,这意味着该成员函数在调用时不会修改对象的任 ...
- 关于BarchNorm的一些学习
<Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift> ...
- 数据库运维实操优质文章文档分享(含Oracle、MySQL等) | 2024年8月刊
本文为大家整理了墨天轮数据社区2024年8月发布的优质技术文章/文档,主题涵盖Oracle.MySQL.PostgreSQL等主流数据库系统以及国产数据库的技术实操,从基础的安装配置到复杂的故障排查, ...
- typeOrm 教程 创建链接数据库
实体 User : import { Entity, PrimaryGeneratedColumn, Column } from "typeorm" @Entity() expor ...
- apisix~按域名进行请求转发
路由route 路由(Route)是请求的入口点,它定义了客户端请求与服务之间的匹配规则.路由可以与服务(Service).上游(Upstream)关联,一个服务可对应一组路由,一个路由可以对应一个上 ...
- k8s的ReplicationController
ReplicationController 存活探针 Kubemetes有以下三种探测容器的机制: HTTPGET探针对容器的IP地址(你指定的端口和路径)执行HTTPGET请求,如果探测器收到响应, ...
- R语言经典统计分析
经典统计分析包括了许多常用的统计方法和技术,用于数据的描述.推断和建模.本节将介绍经典统计分析方法(包括t检验.方差分析.卡方检验.线性回归)在R语言中的实现. 5.1.1 t检验 样本均值(sam ...