@lark-apaas/fullstack-nestjs-core 1.0.3-alpha.0 → 1.0.3-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +6 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -13638,20 +13638,14 @@ function _ts_decorate3(decorators, target, key, desc) {
|
|
|
13638
13638
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13639
13639
|
}
|
|
13640
13640
|
__name(_ts_decorate3, "_ts_decorate");
|
|
13641
|
-
function _ts_metadata(k, v) {
|
|
13642
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
13643
|
-
}
|
|
13644
|
-
__name(_ts_metadata, "_ts_metadata");
|
|
13645
13641
|
var PLATFORM_MODULE_OPTIONS = "PLATFORM_MODULE_OPTIONS";
|
|
13646
13642
|
var PlatformModule = class _PlatformModule {
|
|
13647
13643
|
static {
|
|
13648
13644
|
__name(this, "PlatformModule");
|
|
13649
13645
|
}
|
|
13650
|
-
|
|
13651
|
-
constructor(options) {
|
|
13652
|
-
this.options = options;
|
|
13653
|
-
}
|
|
13646
|
+
static moduleOptions = {};
|
|
13654
13647
|
static forRoot(options = {}) {
|
|
13648
|
+
_PlatformModule.moduleOptions = options;
|
|
13655
13649
|
return {
|
|
13656
13650
|
module: _PlatformModule,
|
|
13657
13651
|
imports: [
|
|
@@ -13706,9 +13700,10 @@ var PlatformModule = class _PlatformModule {
|
|
|
13706
13700
|
* 配置中间件
|
|
13707
13701
|
*/
|
|
13708
13702
|
configure(consumer) {
|
|
13703
|
+
const options = _PlatformModule.moduleOptions;
|
|
13709
13704
|
consumer.apply(UserContextMiddleware, import_nestjs_logger.LoggerContextMiddleware, import_nestjs_datapaas.SqlExecutionContextMiddleware).forRoutes("/*");
|
|
13710
|
-
if (
|
|
13711
|
-
const csrfRoutes =
|
|
13705
|
+
if (options.enableCsrf !== false) {
|
|
13706
|
+
const csrfRoutes = options.csrfRoutes || "/api/*";
|
|
13712
13707
|
if (Array.isArray(csrfRoutes)) {
|
|
13713
13708
|
csrfRoutes.forEach((route) => {
|
|
13714
13709
|
consumer.apply(CsrfMiddleware).forRoutes(route);
|
|
@@ -13721,11 +13716,7 @@ var PlatformModule = class _PlatformModule {
|
|
|
13721
13716
|
};
|
|
13722
13717
|
PlatformModule = _ts_decorate3([
|
|
13723
13718
|
(0, import_common3.Global)(),
|
|
13724
|
-
(0, import_common3.Module)({})
|
|
13725
|
-
_ts_metadata("design:type", Function),
|
|
13726
|
-
_ts_metadata("design:paramtypes", [
|
|
13727
|
-
typeof PlatformModuleOptions === "undefined" ? Object : PlatformModuleOptions
|
|
13728
|
-
])
|
|
13719
|
+
(0, import_common3.Module)({})
|
|
13729
13720
|
], PlatformModule);
|
|
13730
13721
|
|
|
13731
13722
|
// src/modules/devtool/index.ts
|