midway-fatcms 0.0.1-beta.70 → 0.0.1-beta.72
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/.eslintrc.json +14 -14
- package/.prettierrc.js +4 -4
- package/README.md +8 -8
- package/dist/config/config.default.d.ts +3 -3
- package/dist/config/config.default.js +171 -171
- package/dist/config/utils.d.ts +1 -1
- package/dist/config/utils.js +23 -23
- package/dist/configuration.d.ts +7 -7
- package/dist/configuration.js +113 -113
- package/dist/controller/base/BaseApiController.d.ts +42 -42
- package/dist/controller/base/BaseApiController.js +189 -189
- package/dist/controller/gateway/AnyApiGatewayController.d.ts +13 -13
- package/dist/controller/gateway/AnyApiGatewayController.js +55 -55
- package/dist/controller/gateway/AsyncTaskController.d.ts +20 -20
- package/dist/controller/gateway/AsyncTaskController.js +181 -181
- package/dist/controller/gateway/CrudMtdGatewayController.d.ts +21 -21
- package/dist/controller/gateway/CrudMtdGatewayController.js +122 -122
- package/dist/controller/gateway/CrudStdGatewayController.d.ts +39 -39
- package/dist/controller/gateway/CrudStdGatewayController.js +149 -149
- package/dist/controller/gateway/DocGatewayController.d.ts +27 -27
- package/dist/controller/gateway/DocGatewayController.js +179 -179
- package/dist/controller/gateway/FileController.d.ts +32 -28
- package/dist/controller/gateway/FileController.js +160 -145
- package/dist/controller/gateway/ProxyApiGatewayController.d.ts +18 -18
- package/dist/controller/gateway/ProxyApiGatewayController.js +78 -78
- package/dist/controller/gateway/PublicApiController.d.ts +33 -33
- package/dist/controller/gateway/PublicApiController.js +201 -201
- package/dist/controller/gateway/StaticController.d.ts +23 -23
- package/dist/controller/gateway/StaticController.js +286 -286
- package/dist/controller/helpers.controller.d.ts +39 -39
- package/dist/controller/helpers.controller.js +188 -188
- package/dist/controller/home.controller.d.ts +9 -9
- package/dist/controller/home.controller.js +72 -72
- package/dist/controller/manage/AnyApiMangeApi.d.ts +10 -10
- package/dist/controller/manage/AnyApiMangeApi.js +98 -98
- package/dist/controller/manage/AppLogMangeApi.d.ts +10 -10
- package/dist/controller/manage/AppLogMangeApi.js +88 -88
- package/dist/controller/manage/AppMangeApi.d.ts +12 -12
- package/dist/controller/manage/AppMangeApi.js +101 -101
- package/dist/controller/manage/AppPageMangeApi.d.ts +10 -10
- package/dist/controller/manage/AppPageMangeApi.js +87 -87
- package/dist/controller/manage/AppSchemaHistoryApi.d.ts +10 -10
- package/dist/controller/manage/AppSchemaHistoryApi.js +83 -83
- package/dist/controller/manage/CrudMethodsMangeApi.d.ts +10 -10
- package/dist/controller/manage/CrudMethodsMangeApi.js +84 -84
- package/dist/controller/manage/CrudStandardDesignApi.d.ts +46 -46
- package/dist/controller/manage/CrudStandardDesignApi.js +367 -367
- package/dist/controller/manage/DataDictManageApi.d.ts +17 -15
- package/dist/controller/manage/DataDictManageApi.js +165 -133
- package/dist/controller/manage/DeployManageApi.d.ts +19 -19
- package/dist/controller/manage/DeployManageApi.js +180 -180
- package/dist/controller/manage/DocLibManageApi.d.ts +10 -10
- package/dist/controller/manage/DocLibManageApi.js +104 -104
- package/dist/controller/manage/DocManageApi.d.ts +11 -11
- package/dist/controller/manage/DocManageApi.js +130 -130
- package/dist/controller/manage/FileManageApi.d.ts +13 -13
- package/dist/controller/manage/FileManageApi.js +77 -77
- package/dist/controller/manage/LowCodeTplManageApi.d.ts +13 -13
- package/dist/controller/manage/LowCodeTplManageApi.js +86 -86
- package/dist/controller/manage/MenuManageApi.d.ts +10 -10
- package/dist/controller/manage/MenuManageApi.js +93 -93
- package/dist/controller/manage/ProxyApiMangeApi.d.ts +10 -10
- package/dist/controller/manage/ProxyApiMangeApi.js +87 -87
- package/dist/controller/manage/SuperAdminManageApi.d.ts +24 -24
- package/dist/controller/manage/SuperAdminManageApi.js +153 -153
- package/dist/controller/manage/SysConfigMangeApi.d.ts +12 -12
- package/dist/controller/manage/SysConfigMangeApi.js +133 -133
- package/dist/controller/manage/SystemInfoManageApi.d.ts +12 -12
- package/dist/controller/manage/SystemInfoManageApi.js +72 -72
- package/dist/controller/manage/UserAccountManageApi.d.ts +16 -16
- package/dist/controller/manage/UserAccountManageApi.js +153 -153
- package/dist/controller/manage/WorkbenchMangeApi.d.ts +11 -11
- package/dist/controller/manage/WorkbenchMangeApi.js +103 -103
- package/dist/controller/myinfo/AuthController.d.ts +37 -33
- package/dist/controller/myinfo/AuthController.js +157 -136
- package/dist/controller/myinfo/MyInfoController.d.ts +13 -13
- package/dist/controller/myinfo/MyInfoController.js +51 -51
- package/dist/controller/render/AppRenderController.d.ts +12 -12
- package/dist/controller/render/AppRenderController.js +87 -87
- package/dist/controller/test.controller.d.ts +8 -8
- package/dist/controller/test.controller.js +51 -51
- package/dist/filter/default.filter.d.ts +7 -7
- package/dist/filter/default.filter.js +23 -23
- package/dist/filter/notfound.filter.d.ts +5 -5
- package/dist/filter/notfound.filter.js +20 -20
- package/dist/index.d.ts +105 -104
- package/dist/index.js +123 -122
- package/dist/interface.d.ts +29 -29
- package/dist/interface.js +3 -3
- package/dist/libs/crud-pro/CrudPro.d.ts +37 -37
- package/dist/libs/crud-pro/CrudPro.js +136 -136
- package/dist/libs/crud-pro/defaultConfigs.d.ts +4 -4
- package/dist/libs/crud-pro/defaultConfigs.js +15 -15
- package/dist/libs/crud-pro/exceptions.d.ts +106 -106
- package/dist/libs/crud-pro/exceptions.js +119 -119
- package/dist/libs/crud-pro/interfaces.d.ts +166 -166
- package/dist/libs/crud-pro/interfaces.js +12 -12
- package/dist/libs/crud-pro/models/ExecuteContext.d.ts +50 -49
- package/dist/libs/crud-pro/models/ExecuteContext.js +87 -79
- package/dist/libs/crud-pro/models/ExecuteContextFunc.d.ts +38 -38
- package/dist/libs/crud-pro/models/ExecuteContextFunc.js +72 -72
- package/dist/libs/crud-pro/models/FuncContext.d.ts +18 -18
- package/dist/libs/crud-pro/models/FuncContext.js +6 -6
- package/dist/libs/crud-pro/models/RequestCfgModel.d.ts +65 -65
- package/dist/libs/crud-pro/models/RequestCfgModel.js +81 -81
- package/dist/libs/crud-pro/models/RequestModel.d.ts +25 -25
- package/dist/libs/crud-pro/models/RequestModel.js +113 -113
- package/dist/libs/crud-pro/models/ResModel.d.ts +20 -16
- package/dist/libs/crud-pro/models/ResModel.js +2 -2
- package/dist/libs/crud-pro/models/ServiceHub.d.ts +20 -20
- package/dist/libs/crud-pro/models/ServiceHub.js +2 -2
- package/dist/libs/crud-pro/models/SqlCfgModel.d.ts +23 -23
- package/dist/libs/crud-pro/models/SqlCfgModel.js +40 -40
- package/dist/libs/crud-pro/models/SqlSegArg.d.ts +6 -6
- package/dist/libs/crud-pro/models/SqlSegArg.js +12 -12
- package/dist/libs/crud-pro/models/Transaction.d.ts +30 -30
- package/dist/libs/crud-pro/models/Transaction.js +74 -74
- package/dist/libs/crud-pro/models/TransactionMySQL.d.ts +28 -28
- package/dist/libs/crud-pro/models/TransactionMySQL.js +76 -76
- package/dist/libs/crud-pro/models/TransactionPostgres.d.ts +28 -28
- package/dist/libs/crud-pro/models/TransactionPostgres.js +85 -85
- package/dist/libs/crud-pro/models/TransactionSqlServer.d.ts +34 -34
- package/dist/libs/crud-pro/models/TransactionSqlServer.js +92 -92
- package/dist/libs/crud-pro/models/keys.d.ts +110 -110
- package/dist/libs/crud-pro/models/keys.js +154 -154
- package/dist/libs/crud-pro/services/CrudProCachedCfgService.d.ts +11 -11
- package/dist/libs/crud-pro/services/CrudProCachedCfgService.js +73 -73
- package/dist/libs/crud-pro/services/CrudProExecuteFuncService.d.ts +9 -9
- package/dist/libs/crud-pro/services/CrudProExecuteFuncService.js +125 -125
- package/dist/libs/crud-pro/services/CrudProExecuteSqlService.d.ts +17 -17
- package/dist/libs/crud-pro/services/CrudProExecuteSqlService.js +225 -225
- package/dist/libs/crud-pro/services/CrudProFieldUpdateService.d.ts +9 -9
- package/dist/libs/crud-pro/services/CrudProFieldUpdateService.js +51 -51
- package/dist/libs/crud-pro/services/CrudProFieldValidateService.d.ts +13 -13
- package/dist/libs/crud-pro/services/CrudProFieldValidateService.js +148 -148
- package/dist/libs/crud-pro/services/CrudProGenSqlCondition.d.ts +24 -24
- package/dist/libs/crud-pro/services/CrudProGenSqlCondition.js +355 -355
- package/dist/libs/crud-pro/services/CrudProGenSqlService.d.ts +25 -25
- package/dist/libs/crud-pro/services/CrudProGenSqlService.js +165 -165
- package/dist/libs/crud-pro/services/CrudProOriginToExecuteSql.d.ts +32 -32
- package/dist/libs/crud-pro/services/CrudProOriginToExecuteSql.js +339 -339
- package/dist/libs/crud-pro/services/CrudProServiceBase.d.ts +24 -24
- package/dist/libs/crud-pro/services/CrudProServiceBase.js +88 -88
- package/dist/libs/crud-pro/services/CrudProTableMetaService.d.ts +9 -9
- package/dist/libs/crud-pro/services/CrudProTableMetaService.js +72 -72
- package/dist/libs/crud-pro/services/CurdProServiceHub.d.ts +32 -32
- package/dist/libs/crud-pro/services/CurdProServiceHub.js +64 -64
- package/dist/libs/crud-pro/utils/CompareUtils.d.ts +9 -9
- package/dist/libs/crud-pro/utils/CompareUtils.js +25 -25
- package/dist/libs/crud-pro/utils/DatabaseName.d.ts +9 -9
- package/dist/libs/crud-pro/utils/DatabaseName.js +50 -50
- package/dist/libs/crud-pro/utils/DateTimeUtils.d.ts +7 -7
- package/dist/libs/crud-pro/utils/DateTimeUtils.js +21 -21
- package/dist/libs/crud-pro/utils/MemoryRefreshCache.d.ts +19 -19
- package/dist/libs/crud-pro/utils/MemoryRefreshCache.js +47 -47
- package/dist/libs/crud-pro/utils/MessageParseUtils.d.ts +5 -5
- package/dist/libs/crud-pro/utils/MessageParseUtils.js +33 -33
- package/dist/libs/crud-pro/utils/MixinUtils.d.ts +39 -39
- package/dist/libs/crud-pro/utils/MixinUtils.js +255 -255
- package/dist/libs/crud-pro/utils/ModelUtils.d.ts +11 -11
- package/dist/libs/crud-pro/utils/ModelUtils.js +54 -54
- package/dist/libs/crud-pro/utils/MultiKeyMap.d.ts +11 -11
- package/dist/libs/crud-pro/utils/MultiKeyMap.js +63 -63
- package/dist/libs/crud-pro/utils/SqlFuncUtils.d.ts +5 -5
- package/dist/libs/crud-pro/utils/SqlFuncUtils.js +29 -29
- package/dist/libs/crud-pro/utils/TypeUtils.d.ts +40 -40
- package/dist/libs/crud-pro/utils/TypeUtils.js +166 -166
- package/dist/libs/crud-pro/utils/ValidateUtils.d.ts +3 -3
- package/dist/libs/crud-pro/utils/ValidateUtils.js +165 -165
- package/dist/libs/crud-pro/utils/pool/MySQLUtils.d.ts +3 -3
- package/dist/libs/crud-pro/utils/pool/MySQLUtils.js +19 -19
- package/dist/libs/crud-pro/utils/pool/PostgresUtils.d.ts +3 -3
- package/dist/libs/crud-pro/utils/pool/PostgresUtils.js +20 -20
- package/dist/libs/crud-pro/utils/pool/SqlServerUtils.d.ts +3 -3
- package/dist/libs/crud-pro/utils/pool/SqlServerUtils.js +20 -20
- package/dist/libs/crud-pro/utils/sqlConvert/convertColumnName.d.ts +4 -4
- package/dist/libs/crud-pro/utils/sqlConvert/convertColumnName.js +35 -35
- package/dist/libs/crud-pro/utils/sqlConvert/convertMix.d.ts +3 -3
- package/dist/libs/crud-pro/utils/sqlConvert/convertMix.js +22 -22
- package/dist/libs/crud-pro/utils/sqlConvert/convertMsSql.d.ts +2 -2
- package/dist/libs/crud-pro/utils/sqlConvert/convertMsSql.js +14 -14
- package/dist/libs/crud-pro/utils/sqlConvert/convertPgSql.d.ts +2 -2
- package/dist/libs/crud-pro/utils/sqlConvert/convertPgSql.js +14 -14
- package/dist/libs/crud-pro/utils/sqlConvert/convertPgType.d.ts +2 -2
- package/dist/libs/crud-pro/utils/sqlConvert/convertPgType.js +128 -128
- package/dist/libs/global-config/global-config.d.ts +69 -69
- package/dist/libs/global-config/global-config.js +36 -36
- package/dist/libs/utils/AsymmetricCrypto.d.ts +76 -76
- package/dist/libs/utils/AsymmetricCrypto.js +261 -261
- package/dist/libs/utils/base64.d.ts +9 -9
- package/dist/libs/utils/base64.js +42 -42
- package/dist/libs/utils/common-dto.d.ts +18 -18
- package/dist/libs/utils/common-dto.js +40 -40
- package/dist/libs/utils/crypto-utils.d.ts +3 -3
- package/dist/libs/utils/crypto-utils.js +46 -46
- package/dist/libs/utils/errorToString.d.ts +2 -2
- package/dist/libs/utils/errorToString.js +57 -57
- package/dist/libs/utils/fatcms-request.d.ts +30 -30
- package/dist/libs/utils/fatcms-request.js +104 -104
- package/dist/libs/utils/format-url.d.ts +2 -2
- package/dist/libs/utils/format-url.js +13 -13
- package/dist/libs/utils/functions.d.ts +5 -5
- package/dist/libs/utils/functions.js +76 -72
- package/dist/libs/utils/ordernum-utils.d.ts +2 -2
- package/dist/libs/utils/ordernum-utils.js +13 -13
- package/dist/libs/utils/parseConfig.d.ts +8 -8
- package/dist/libs/utils/parseConfig.js +47 -47
- package/dist/libs/utils/parseCreateSql.d.ts +10 -10
- package/dist/libs/utils/parseCreateSql.js +87 -87
- package/dist/libs/utils/render-utils.d.ts +37 -37
- package/dist/libs/utils/render-utils.js +154 -154
- package/dist/middleware/forbidden.middleware.d.ts +10 -10
- package/dist/middleware/forbidden.middleware.js +54 -54
- package/dist/middleware/global.middleware.d.ts +10 -10
- package/dist/middleware/global.middleware.js +273 -273
- package/dist/middleware/permission.middleware.d.ts +18 -18
- package/dist/middleware/permission.middleware.js +74 -74
- package/dist/middleware/rediscache.middleware.d.ts +3 -3
- package/dist/middleware/rediscache.middleware.js +77 -77
- package/dist/middleware/redislock.middleware.d.ts +7 -7
- package/dist/middleware/redislock.middleware.js +72 -72
- package/dist/middleware/tx.middleware.d.ts +9 -9
- package/dist/middleware/tx.middleware.js +40 -40
- package/dist/models/AsyncTaskModel.d.ts +74 -74
- package/dist/models/AsyncTaskModel.js +31 -31
- package/dist/models/RedisKeys.d.ts +15 -15
- package/dist/models/RedisKeys.js +18 -18
- package/dist/models/SystemEntities.d.ts +117 -117
- package/dist/models/SystemEntities.js +17 -17
- package/dist/models/SystemPerm.d.ts +95 -95
- package/dist/models/SystemPerm.js +100 -100
- package/dist/models/SystemTables.d.ts +25 -25
- package/dist/models/SystemTables.js +28 -28
- package/dist/models/WorkbenchInfoTools.d.ts +7 -7
- package/dist/models/WorkbenchInfoTools.js +20 -20
- package/dist/models/bizmodels.d.ts +138 -132
- package/dist/models/bizmodels.js +61 -54
- package/dist/models/contextLogger.d.ts +27 -27
- package/dist/models/contextLogger.js +119 -119
- package/dist/models/devops.d.ts +12 -12
- package/dist/models/devops.js +19 -19
- package/dist/models/userSession.d.ts +65 -64
- package/dist/models/userSession.js +168 -167
- package/dist/schedule/anonymousContext.d.ts +14 -14
- package/dist/schedule/anonymousContext.js +62 -61
- package/dist/schedule/index.d.ts +4 -4
- package/dist/schedule/index.js +10 -10
- package/dist/schedule/runSchedule.d.ts +12 -12
- package/dist/schedule/runSchedule.js +68 -68
- package/dist/schedule/scheduleNames.d.ts +13 -13
- package/dist/schedule/scheduleNames.js +17 -17
- package/dist/service/AuthService.d.ts +57 -71
- package/dist/service/AuthService.js +265 -270
- package/dist/service/EnumInfoService.d.ts +30 -31
- package/dist/service/EnumInfoService.js +97 -120
- package/dist/service/FileCenterService.d.ts +64 -43
- package/dist/service/FileCenterService.js +422 -351
- package/dist/service/SysAppService.d.ts +14 -14
- package/dist/service/SysAppService.js +96 -96
- package/dist/service/SysConfigService.d.ts +10 -10
- package/dist/service/SysConfigService.js +64 -64
- package/dist/service/SysDictDataService.d.ts +9 -0
- package/dist/service/SysDictDataService.js +72 -0
- package/dist/service/UserAccountService.d.ts +23 -23
- package/dist/service/UserAccountService.js +107 -107
- package/dist/service/UserSessionService.d.ts +43 -43
- package/dist/service/UserSessionService.js +163 -163
- package/dist/service/VisitStatService.d.ts +14 -14
- package/dist/service/VisitStatService.js +158 -158
- package/dist/service/WorkbenchService.d.ts +59 -59
- package/dist/service/WorkbenchService.js +249 -249
- package/dist/service/anyapi/AnyApiSandboxService.d.ts +15 -15
- package/dist/service/anyapi/AnyApiSandboxService.js +110 -110
- package/dist/service/anyapi/AnyApiService.d.ts +27 -27
- package/dist/service/anyapi/AnyApiService.js +181 -181
- package/dist/service/asyncTask/AsyncTaskRunnerService.d.ts +50 -50
- package/dist/service/asyncTask/AsyncTaskRunnerService.js +287 -287
- package/dist/service/asyncTask/AsyncTaskService.d.ts +7 -7
- package/dist/service/asyncTask/AsyncTaskService.js +34 -34
- package/dist/service/asyncTask/handler/ExcelInfoModel.d.ts +10 -10
- package/dist/service/asyncTask/handler/ExcelInfoModel.js +2 -2
- package/dist/service/asyncTask/handler/ExportExcelAsyncTaskHandler.d.ts +7 -7
- package/dist/service/asyncTask/handler/ExportExcelAsyncTaskHandler.js +216 -216
- package/dist/service/asyncTask/handler/ExportExcelByInnerHttpHandler.d.ts +36 -36
- package/dist/service/asyncTask/handler/ExportExcelByInnerHttpHandler.js +141 -141
- package/dist/service/asyncTask/handler/ExportExcelByStdCrudHandler.d.ts +46 -46
- package/dist/service/asyncTask/handler/ExportExcelByStdCrudHandler.js +135 -135
- package/dist/service/base/ApiBaseService.d.ts +15 -15
- package/dist/service/base/ApiBaseService.js +50 -50
- package/dist/service/base/ApiRateLimiter.d.ts +10 -10
- package/dist/service/base/ApiRateLimiter.js +51 -51
- package/dist/service/base/BaseService.d.ts +41 -41
- package/dist/service/base/BaseService.js +101 -101
- package/dist/service/base/cache/CacheServiceFactory.d.ts +23 -23
- package/dist/service/base/cache/CacheServiceFactory.js +83 -83
- package/dist/service/base/cache/CtxCache.d.ts +18 -18
- package/dist/service/base/cache/CtxCache.js +37 -37
- package/dist/service/base/cache/DiskCache.d.ts +19 -19
- package/dist/service/base/cache/DiskCache.js +74 -74
- package/dist/service/base/cache/MemoryCache.d.ts +12 -12
- package/dist/service/base/cache/MemoryCache.js +58 -58
- package/dist/service/base/cache/NoneCache.d.ts +10 -10
- package/dist/service/base/cache/NoneCache.js +19 -19
- package/dist/service/base/cache/RedisCache.d.ts +14 -14
- package/dist/service/base/cache/RedisCache.js +31 -31
- package/dist/service/crudstd/CrudStdActionService.d.ts +17 -17
- package/dist/service/crudstd/CrudStdActionService.js +32 -32
- package/dist/service/crudstd/CrudStdConstant.d.ts +58 -58
- package/dist/service/crudstd/CrudStdConstant.js +64 -64
- package/dist/service/crudstd/CrudStdRelationService.d.ts +10 -10
- package/dist/service/crudstd/CrudStdRelationService.js +121 -121
- package/dist/service/crudstd/CrudStdService.d.ts +60 -60
- package/dist/service/crudstd/CrudStdService.js +376 -376
- package/dist/service/curd/CrudProQuick.d.ts +50 -50
- package/dist/service/curd/CrudProQuick.js +163 -163
- package/dist/service/curd/CurdMixByAccountService.d.ts +13 -13
- package/dist/service/curd/CurdMixByAccountService.js +151 -151
- package/dist/service/curd/CurdMixByDictService.d.ts +12 -12
- package/dist/service/curd/CurdMixByDictService.js +114 -114
- package/dist/service/curd/CurdMixByLinkToCustomService.d.ts +30 -30
- package/dist/service/curd/CurdMixByLinkToCustomService.js +202 -202
- package/dist/service/curd/CurdMixBySysConfigService.d.ts +13 -13
- package/dist/service/curd/CurdMixBySysConfigService.js +116 -116
- package/dist/service/curd/CurdMixByWorkbenchService.d.ts +11 -11
- package/dist/service/curd/CurdMixByWorkbenchService.js +80 -80
- package/dist/service/curd/CurdMixService.d.ts +28 -28
- package/dist/service/curd/CurdMixService.js +100 -100
- package/dist/service/curd/CurdMixUtils.d.ts +57 -57
- package/dist/service/curd/CurdMixUtils.js +331 -331
- package/dist/service/curd/CurdProService.d.ts +32 -32
- package/dist/service/curd/CurdProService.js +212 -212
- package/dist/service/curd/fixCfgModel.d.ts +3 -3
- package/dist/service/curd/fixCfgModel.js +104 -104
- package/dist/service/proxyapi/ProxyApiLoadService.d.ts +21 -21
- package/dist/service/proxyapi/ProxyApiLoadService.js +167 -167
- package/dist/service/proxyapi/ProxyApiService.d.ts +61 -61
- package/dist/service/proxyapi/ProxyApiService.js +294 -294
- package/dist/service/proxyapi/ProxyApiUtils.d.ts +15 -15
- package/dist/service/proxyapi/ProxyApiUtils.js +34 -34
- package/dist/service/proxyapi/RouteHandler.d.ts +5 -5
- package/dist/service/proxyapi/RouteHandler.js +9 -9
- package/dist/service/proxyapi/RouteTrie.d.ts +12 -12
- package/dist/service/proxyapi/RouteTrie.js +63 -63
- package/dist/service/proxyapi/WeightedRandom.d.ts +9 -9
- package/dist/service/proxyapi/WeightedRandom.js +31 -31
- package/dist/service/proxyapi/WeightedRoundRobin.d.ts +8 -8
- package/dist/service/proxyapi/WeightedRoundRobin.js +32 -32
- package/index.d.ts +10 -10
- package/package.json +87 -87
- package/src/config/config.default.ts +1 -1
- package/src/controller/base/BaseApiController.ts +6 -7
- package/src/controller/gateway/FileController.ts +17 -2
- package/src/controller/manage/DataDictManageApi.ts +41 -0
- package/src/controller/myinfo/AuthController.ts +23 -4
- package/src/index.ts +1 -0
- package/src/libs/crud-pro/models/ExecuteContext.ts +10 -1
- package/src/libs/crud-pro/models/ResModel.ts +6 -1
- package/src/libs/utils/AsymmetricCrypto.ts +307 -310
- package/src/libs/utils/format-url.ts +15 -15
- package/src/libs/utils/functions.ts +7 -3
- package/src/libs/utils/render-utils.ts +216 -216
- package/src/models/WorkbenchInfoTools.ts +19 -19
- package/src/models/bizmodels.ts +8 -1
- package/src/models/userSession.ts +2 -0
- package/src/schedule/anonymousContext.ts +1 -0
- package/src/service/AuthService.ts +44 -48
- package/src/service/EnumInfoService.ts +16 -42
- package/src/service/FileCenterService.ts +108 -20
- package/src/service/SysAppService.ts +88 -88
- package/src/service/SysDictDataService.ts +63 -0
- package/src/service/WorkbenchService.ts +277 -277
- package/src/service/base/cache/CacheServiceFactory.ts +86 -86
- package/src/service/base/cache/CtxCache.ts +45 -45
- package/src/service/base/cache/DiskCache.ts +82 -82
- package/src/service/base/cache/MemoryCache.ts +68 -68
- package/src/service/base/cache/NoneCache.ts +24 -24
- package/src/service/base/cache/RedisCache.ts +41 -41
- package/src/service/curd/CrudProQuick.ts +3 -3
- package/tsconfig.json +32 -32
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import {Inject, Provide, Config} from '@midwayjs/core';
|
|
2
|
+
import {Context} from '@midwayjs/koa';
|
|
3
|
+
import {KeysOfSimpleSQL} from '@/libs/crud-pro/models/keys';
|
|
4
|
+
import {CurdMixService} from './curd/CurdMixService';
|
|
5
5
|
import * as md5 from 'md5';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
6
|
+
import {UserAccountService} from './UserAccountService';
|
|
7
|
+
import {createUniqueId} from '@/libs/utils/functions';
|
|
8
|
+
import {IConsumerUserInfo, ISessionInfo, SYS_ACCOUNT_TYPE} from '@/models/userSession';
|
|
9
|
+
import {SystemTables} from '@/models/SystemTables';
|
|
10
|
+
import {UserSessionService} from './UserSessionService';
|
|
11
|
+
import {CommonResult} from '@/libs/utils/common-dto';
|
|
12
|
+
import {isEnableSuperAdmin} from '@/libs/utils/fatcms-request';
|
|
13
|
+
import {CommonException} from '@/libs/crud-pro/exceptions';
|
|
14
|
+
import {GLOBAL_STATIC_CONFIG} from '@/libs/global-config/global-config';
|
|
15
|
+
import {AsymmetricCrypto} from '@/libs/utils/AsymmetricCrypto';
|
|
16
16
|
|
|
17
17
|
@Provide()
|
|
18
18
|
export class AuthService {
|
|
@@ -88,7 +88,7 @@ export class AuthService {
|
|
|
88
88
|
* @param consumerUserInfo
|
|
89
89
|
* @param loadRoleCodes
|
|
90
90
|
*/
|
|
91
|
-
public async createUserSessionForConsumer(consumerUserInfo: IConsumerUserInfo, loadRoleCodes?: boolean) {
|
|
91
|
+
public async createUserSessionForConsumer(consumerUserInfo: IConsumerUserInfo, loadRoleCodes?: boolean): Promise<ISessionInfo> {
|
|
92
92
|
const sessionId = createUniqueId();
|
|
93
93
|
|
|
94
94
|
const accountId = consumerUserInfo.accountId;
|
|
@@ -102,7 +102,7 @@ export class AuthService {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
|
|
105
|
-
const {
|
|
105
|
+
const {publicKey, privateKey} = await AsymmetricCrypto.generateKeyPair();
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
const sessionInfo: ISessionInfo = {
|
|
@@ -117,27 +117,21 @@ export class AuthService {
|
|
|
117
117
|
accountType: consumerUserInfo.accountType,
|
|
118
118
|
publicKey,
|
|
119
119
|
privateKey,
|
|
120
|
+
sessionIdCreatedAt: Date.now(),
|
|
120
121
|
};
|
|
121
122
|
|
|
122
123
|
await this.userSessionService.saveUserSession(sessionInfo);
|
|
123
124
|
|
|
124
|
-
return
|
|
125
|
-
sessionId,
|
|
126
|
-
loginName: sessionInfo.loginName,
|
|
127
|
-
accountId: sessionInfo.accountId,
|
|
128
|
-
nickName: sessionInfo.nickName,
|
|
129
|
-
avatar: sessionInfo.avatar,
|
|
130
|
-
workbenchCode: sessionInfo.workbenchCode,
|
|
131
|
-
accountType: sessionInfo.accountType,
|
|
132
|
-
};
|
|
125
|
+
return sessionInfo;
|
|
133
126
|
}
|
|
134
127
|
|
|
135
128
|
/**
|
|
136
129
|
* 创建一个Session
|
|
137
130
|
* @param loginName
|
|
138
131
|
* @param workbenchCode
|
|
132
|
+
* @param bizExt
|
|
139
133
|
*/
|
|
140
|
-
public async createUserSession(loginName: string, workbenchCode: string, bizExt?: any) {
|
|
134
|
+
public async createUserSession(loginName: string, workbenchCode: string, bizExt?: any): Promise<ISessionInfo> {
|
|
141
135
|
const userAccount = await this.queryUserAccountByLoginName(loginName);
|
|
142
136
|
|
|
143
137
|
if (!userAccount) {
|
|
@@ -149,7 +143,7 @@ export class AuthService {
|
|
|
149
143
|
const roleCodes = await this.queryUserRoleCodeList(accountId);
|
|
150
144
|
const functionCodes = await this.queryFunctionCodeList(roleCodes);
|
|
151
145
|
|
|
152
|
-
const {
|
|
146
|
+
const {publicKey, privateKey} = await AsymmetricCrypto.generateKeyPair();
|
|
153
147
|
|
|
154
148
|
const sessionInfo: ISessionInfo = {
|
|
155
149
|
nickName: userAccount.nick_name,
|
|
@@ -164,6 +158,7 @@ export class AuthService {
|
|
|
164
158
|
bizExt: {},
|
|
165
159
|
publicKey,
|
|
166
160
|
privateKey,
|
|
161
|
+
sessionIdCreatedAt: Date.now(),
|
|
167
162
|
};
|
|
168
163
|
|
|
169
164
|
if (bizExt && typeof bizExt === 'object') {
|
|
@@ -172,15 +167,7 @@ export class AuthService {
|
|
|
172
167
|
|
|
173
168
|
await this.userSessionService.saveUserSession(sessionInfo);
|
|
174
169
|
|
|
175
|
-
return
|
|
176
|
-
sessionId,
|
|
177
|
-
loginName,
|
|
178
|
-
accountId,
|
|
179
|
-
nickName: userAccount.nick_name,
|
|
180
|
-
avatar: userAccount.avatar,
|
|
181
|
-
workbenchCode: sessionInfo.workbenchCode,
|
|
182
|
-
accountType: sessionInfo.accountType,
|
|
183
|
-
};
|
|
170
|
+
return sessionInfo;
|
|
184
171
|
}
|
|
185
172
|
|
|
186
173
|
/**
|
|
@@ -228,11 +215,11 @@ export class AuthService {
|
|
|
228
215
|
* @private
|
|
229
216
|
*/
|
|
230
217
|
private async queryUserRoleCodeList(accountId: string): Promise<string[]> {
|
|
231
|
-
const {
|
|
218
|
+
const {SystemDbName, SystemDbType} = GLOBAL_STATIC_CONFIG.getConfig();
|
|
232
219
|
|
|
233
220
|
const res = await this.curdMixService.executeCrudByCfg(
|
|
234
221
|
{
|
|
235
|
-
condition: {
|
|
222
|
+
condition: {account_id: accountId},
|
|
236
223
|
limit: 10000,
|
|
237
224
|
},
|
|
238
225
|
{
|
|
@@ -243,7 +230,7 @@ export class AuthService {
|
|
|
243
230
|
}
|
|
244
231
|
);
|
|
245
232
|
const rows = res.getResModel().rows || [];
|
|
246
|
-
const roleCodes: string[] = rows.map(({
|
|
233
|
+
const roleCodes: string[] = rows.map(({role_code}) => {
|
|
247
234
|
return role_code as string;
|
|
248
235
|
});
|
|
249
236
|
return [...new Set(roleCodes)];
|
|
@@ -259,11 +246,11 @@ export class AuthService {
|
|
|
259
246
|
return [];
|
|
260
247
|
}
|
|
261
248
|
|
|
262
|
-
const {
|
|
249
|
+
const {SystemDbName, SystemDbType} = GLOBAL_STATIC_CONFIG.getConfig();
|
|
263
250
|
|
|
264
251
|
const res = await this.curdMixService.executeCrudByCfg(
|
|
265
252
|
{
|
|
266
|
-
condition: {
|
|
253
|
+
condition: {role_code: {$in: roleCodeList}},
|
|
267
254
|
limit: 10000,
|
|
268
255
|
},
|
|
269
256
|
{
|
|
@@ -274,7 +261,7 @@ export class AuthService {
|
|
|
274
261
|
}
|
|
275
262
|
);
|
|
276
263
|
const rows = res.getResModel().rows || [];
|
|
277
|
-
const funcCodes: string[] = rows.map(({
|
|
264
|
+
const funcCodes: string[] = rows.map(({func_code}) => {
|
|
278
265
|
return func_code;
|
|
279
266
|
});
|
|
280
267
|
return [...new Set(funcCodes)];
|
|
@@ -284,16 +271,25 @@ export class AuthService {
|
|
|
284
271
|
return this.userSessionService.removeUserSession(sessionId);
|
|
285
272
|
}
|
|
286
273
|
|
|
287
|
-
async refreshSession(sessionInfo: ISessionInfo): Promise<ISessionInfo> {
|
|
288
|
-
const oldSessionId = sessionInfo.sessionId;
|
|
289
|
-
|
|
290
|
-
const sessionId = createUniqueId();
|
|
291
|
-
const newSessionInfo: ISessionInfo = { ...sessionInfo, sessionId };
|
|
292
274
|
|
|
275
|
+
async refreshSession(sessionInfo: ISessionInfo): Promise<ISessionInfo> {
|
|
276
|
+
const roleCodes = await this.queryUserRoleCodeList(sessionInfo.accountId);
|
|
277
|
+
const functionCodes = await this.queryFunctionCodeList(roleCodes);
|
|
278
|
+
const newSessionInfo: ISessionInfo = {...sessionInfo, roleCodes, functionCodes};
|
|
293
279
|
await this.userSessionService.saveUserSession(newSessionInfo);
|
|
280
|
+
return newSessionInfo;
|
|
281
|
+
}
|
|
294
282
|
|
|
295
|
-
await this.removeUserSession(oldSessionId);
|
|
296
283
|
|
|
284
|
+
async updateSessionBizExt(sessionInfo: ISessionInfo, bizExt: any): Promise<ISessionInfo> {
|
|
285
|
+
const newSessionInfo: ISessionInfo = {...sessionInfo};
|
|
286
|
+
if (bizExt && typeof bizExt === 'object') {
|
|
287
|
+
const oldBizExt = typeof sessionInfo.bizExt === 'object' ? sessionInfo.bizExt : {};
|
|
288
|
+
newSessionInfo.bizExt = Object.assign({}, oldBizExt, bizExt);
|
|
289
|
+
}
|
|
290
|
+
await this.userSessionService.saveUserSession(newSessionInfo);
|
|
297
291
|
return newSessionInfo;
|
|
298
292
|
}
|
|
293
|
+
|
|
294
|
+
|
|
299
295
|
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import {Inject, Provide} from '@midwayjs/core';
|
|
2
2
|
import {Context} from '@midwayjs/koa';
|
|
3
|
-
import {KeysOfSimpleSQL} from '@/libs/crud-pro/models/keys';
|
|
4
|
-
import {CurdProService} from './curd/CurdProService';
|
|
5
3
|
import {RelatedType} from './curd/CurdMixUtils';
|
|
6
|
-
import {SystemTables} from '@/models/SystemTables';
|
|
7
4
|
import {IEnumInfo, parseConfigContentToEnumInfo} from '@/libs/utils/parseConfig';
|
|
8
5
|
import {CurdMixByLinkToCustomService} from './curd/CurdMixByLinkToCustomService';
|
|
9
|
-
import {GLOBAL_STATIC_CONFIG} from '@/libs/global-config/global-config';
|
|
10
|
-
import {CacheServiceFactory} from './base/cache/CacheServiceFactory';
|
|
11
|
-
import { CacheNameEnum } from "@/models/bizmodels";
|
|
12
6
|
import { SysConfigService } from "@/service/SysConfigService";
|
|
7
|
+
import {SysDictDataService} from "@/service/SysDictDataService";
|
|
13
8
|
|
|
14
9
|
interface IQueryEnumInfo {
|
|
15
10
|
type: RelatedType;
|
|
@@ -29,18 +24,16 @@ function filterEmpty(e: IEnumInfo): boolean {
|
|
|
29
24
|
@Provide()
|
|
30
25
|
export class EnumInfoService {
|
|
31
26
|
@Inject()
|
|
32
|
-
ctx: Context;
|
|
33
|
-
@Inject()
|
|
34
|
-
private curdProService: CurdProService;
|
|
27
|
+
protected ctx: Context;
|
|
35
28
|
|
|
36
29
|
@Inject()
|
|
37
|
-
private
|
|
30
|
+
private sysConfigService: SysConfigService
|
|
38
31
|
|
|
39
32
|
@Inject()
|
|
40
|
-
private
|
|
33
|
+
private sysDictDataService: SysDictDataService;
|
|
41
34
|
|
|
42
35
|
@Inject()
|
|
43
|
-
private
|
|
36
|
+
private curdMixByLinkToCustomService: CurdMixByLinkToCustomService;
|
|
44
37
|
|
|
45
38
|
async queryEnumInfo(codeList: IQueryEnumInfo[], refreshCache: boolean): Promise<IQueryEnumResult[]> {
|
|
46
39
|
|
|
@@ -51,19 +44,10 @@ export class EnumInfoService {
|
|
|
51
44
|
if (type === RelatedType.sysCfgEnum) {
|
|
52
45
|
return await this.queryEnumInfoBySysCfgEnum(code);
|
|
53
46
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
refreshCache,
|
|
59
|
-
cacheName: CacheNameEnum.GetEnumInfoByCode,
|
|
60
|
-
getter: async () => {
|
|
61
|
-
if (type === RelatedType.dict) {
|
|
62
|
-
return await this.queryEnumInfoItemByDict(code);
|
|
63
|
-
}
|
|
64
|
-
return [];
|
|
65
|
-
},
|
|
66
|
-
});
|
|
47
|
+
if (type === RelatedType.dict) {
|
|
48
|
+
return await this.queryEnumInfoItemByDict(code);
|
|
49
|
+
}
|
|
50
|
+
return []
|
|
67
51
|
};
|
|
68
52
|
|
|
69
53
|
const result = [];
|
|
@@ -98,27 +82,17 @@ export class EnumInfoService {
|
|
|
98
82
|
private async queryEnumInfoBySysCfgEnum(code: string): Promise<IEnumInfo[]> {
|
|
99
83
|
const obj = await this.sysConfigService.getSysConfigOne(code);
|
|
100
84
|
const rows = parseConfigContentToEnumInfo(obj);
|
|
85
|
+
if (!rows) {
|
|
86
|
+
return [];
|
|
87
|
+
}
|
|
101
88
|
return rows.map(e => ({ label: e.label, value: e.value, style: e.style, children: e.children })).filter(filterEmpty);
|
|
102
89
|
}
|
|
103
90
|
|
|
104
91
|
private async queryEnumInfoItemByDict(code: string): Promise<IEnumInfo[]> {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
{
|
|
109
|
-
condition: { dict_code: code },
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
sqlTable: SystemTables.sys_data_dict_item,
|
|
113
|
-
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_QUERY,
|
|
114
|
-
sqlDatabase: SystemDbName,
|
|
115
|
-
sqlDbType: SystemDbType,
|
|
116
|
-
}
|
|
117
|
-
);
|
|
118
|
-
const obj = res1.getResRows();
|
|
119
|
-
if (!obj) {
|
|
120
|
-
return null;
|
|
92
|
+
const rows = await this.sysDictDataService.getDataDictItemsByDictCode(code);
|
|
93
|
+
if (!rows) {
|
|
94
|
+
return [];
|
|
121
95
|
}
|
|
122
|
-
return
|
|
96
|
+
return rows.map(e => ({ label: e.label, value: e.value })).filter(filterEmpty);
|
|
123
97
|
}
|
|
124
98
|
}
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { Provide
|
|
2
|
-
import {
|
|
1
|
+
import {Inject, Provide} from '@midwayjs/core';
|
|
2
|
+
import {Context} from '@midwayjs/koa';
|
|
3
3
|
import * as mime from 'mime-types';
|
|
4
4
|
import * as md5 from 'md5';
|
|
5
5
|
import * as fs from 'fs';
|
|
6
6
|
import * as util from 'util';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
7
|
+
import {BizException} from '@/models/devops';
|
|
8
|
+
import {CurdMixService} from './curd/CurdMixService';
|
|
9
|
+
import {KeysOfSimpleSQL, KeysOfValidators} from '@/libs/crud-pro/models/keys';
|
|
10
|
+
import {AccessType, FileCategoryType, IEntityCommonInfo, UploadCategoryType} from '@/models/bizmodels';
|
|
11
|
+
import {IRequestCfgModel, IRequestModel} from '@/libs/crud-pro/interfaces';
|
|
12
|
+
import {BaseService} from './base/BaseService';
|
|
13
|
+
import {GLOBAL_STATIC_CONFIG} from '@/libs/global-config/global-config';
|
|
14
|
+
import {ResModelPageQuery} from "@/libs/crud-pro/models/ResModel";
|
|
14
15
|
|
|
15
16
|
function getSuffix(s: string): string {
|
|
16
17
|
if (s) {
|
|
@@ -72,18 +73,47 @@ function getAssetsContentType(filename: string): string {
|
|
|
72
73
|
}
|
|
73
74
|
|
|
74
75
|
// JPG、PNG、BMP、GIF、WebP、TIFF
|
|
75
|
-
export function isImageFile(fileKey: string) {
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
export function isImageFile(fileKey: string, mimeType: string) {
|
|
77
|
+
if (typeof mimeType === 'string' && mimeType.startsWith('image/')) return true;
|
|
78
|
+
const fileKey2= fileKey.toLowerCase();
|
|
79
|
+
const suffixList = ['.jpg', '.jpeg', '.png', '.bmp', '.gif', '.webp', '.tiff'];
|
|
80
|
+
return suffixList.some(suffix => fileKey2.endsWith(suffix));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export function isOfficeFile(fileKey: string, mimeType: string) {
|
|
84
|
+
if (typeof mimeType === 'string' &&
|
|
85
|
+
(mimeType.startsWith('application/vnd.openxmlformats-officedocument') ||
|
|
86
|
+
mimeType.startsWith('application/msword') ||
|
|
87
|
+
mimeType.startsWith('application/vnd.ms-'))) {
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
const fileKey2= fileKey.toLowerCase();
|
|
91
|
+
const suffixList = ['.docx', '.xlsx', '.pptx', '.doc', '.xls', '.ppt', '.pdf'];
|
|
92
|
+
return suffixList.some(suffix => fileKey2.endsWith(suffix));
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function isZipFile(fileKey: string, mimeType: string) {
|
|
96
|
+
const suffixList = ['.zip', '.7z', '.rar'];
|
|
97
|
+
const fileKey2= fileKey.toLowerCase();
|
|
98
|
+
return suffixList.some(suffix => fileKey2.endsWith(suffix));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
export function getFileCategory(fileKey: string, mimeType: string):FileCategoryType{
|
|
104
|
+
if (isImageFile(fileKey, mimeType)){
|
|
105
|
+
return FileCategoryType.image;
|
|
83
106
|
}
|
|
84
|
-
|
|
107
|
+
if (isOfficeFile(fileKey, mimeType)){
|
|
108
|
+
return FileCategoryType.office;
|
|
109
|
+
}
|
|
110
|
+
if (isZipFile(fileKey, mimeType)){
|
|
111
|
+
return FileCategoryType.zip;
|
|
112
|
+
}
|
|
113
|
+
return FileCategoryType.others;
|
|
85
114
|
}
|
|
86
115
|
|
|
116
|
+
|
|
87
117
|
interface IFileInfo extends IEntityCommonInfo {
|
|
88
118
|
file_key: string;
|
|
89
119
|
file_name: string;
|
|
@@ -96,6 +126,7 @@ interface IFileInfo extends IEntityCommonInfo {
|
|
|
96
126
|
storage_engine: string;
|
|
97
127
|
access_type: string;
|
|
98
128
|
referer: string;
|
|
129
|
+
file_category: string;
|
|
99
130
|
}
|
|
100
131
|
|
|
101
132
|
class FileDB {
|
|
@@ -167,6 +198,21 @@ class FileDB {
|
|
|
167
198
|
};
|
|
168
199
|
return await this.curdMixService.executeCrudByCfg({ condition: { id } }, cfgModel);
|
|
169
200
|
}
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
public async getFilePage(reqModel: IRequestModel): Promise<ResModelPageQuery> {
|
|
204
|
+
const { SystemDbName, SystemDbType } = GLOBAL_STATIC_CONFIG.getConfig();
|
|
205
|
+
const cfgModel: IRequestCfgModel = {
|
|
206
|
+
sqlTable: 'sys_file',
|
|
207
|
+
sqlSimpleName: KeysOfSimpleSQL.SIMPLE_QUERY_PAGE,
|
|
208
|
+
sqlDatabase: SystemDbName,
|
|
209
|
+
sqlDbType: SystemDbType,
|
|
210
|
+
};
|
|
211
|
+
const res = await this.curdMixService.executeCrudByCfg(reqModel, cfgModel);
|
|
212
|
+
return res.getResModelForQueryPage();
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
170
216
|
}
|
|
171
217
|
|
|
172
218
|
interface IUploadFileToOSSOptions {
|
|
@@ -284,6 +330,7 @@ export class FileCenterService extends BaseService {
|
|
|
284
330
|
access_type: accessType,
|
|
285
331
|
referer: referer,
|
|
286
332
|
upload_origin: uploadOrigin,
|
|
333
|
+
file_category: getFileCategory(fileKey, file.mimeType)
|
|
287
334
|
};
|
|
288
335
|
|
|
289
336
|
if (isAssets) {
|
|
@@ -302,6 +349,7 @@ export class FileCenterService extends BaseService {
|
|
|
302
349
|
mimeType: file.mimeType,
|
|
303
350
|
name: result.name,
|
|
304
351
|
url: result.url,
|
|
352
|
+
file_category: saveInfo.file_category,
|
|
305
353
|
};
|
|
306
354
|
}
|
|
307
355
|
|
|
@@ -328,8 +376,12 @@ export class FileCenterService extends BaseService {
|
|
|
328
376
|
}
|
|
329
377
|
}
|
|
330
378
|
|
|
331
|
-
public async
|
|
332
|
-
|
|
379
|
+
public async getFileInfo(fileKey: string): Promise<IFileInfo> {
|
|
380
|
+
return await this.fileBD.getFileInfo(fileKey);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
public async downloadFile(fileInfo: IFileInfo, streaming: boolean, process: string): Promise<any> {
|
|
384
|
+
|
|
333
385
|
if (!fileInfo || fileInfo.status !== 1) {
|
|
334
386
|
throw new BizException('文件不存在');
|
|
335
387
|
}
|
|
@@ -392,4 +444,40 @@ export class FileCenterService extends BaseService {
|
|
|
392
444
|
|
|
393
445
|
return 'OK';
|
|
394
446
|
}
|
|
447
|
+
|
|
448
|
+
|
|
449
|
+
public async getCurrentUserFiles(file_category: FileCategoryType): Promise<ResModelPageQuery> {
|
|
450
|
+
const userSession = this.ctx.userSession;
|
|
451
|
+
if (!userSession.isLogin()) {
|
|
452
|
+
throw new BizException('您当前未登录,您没有访问此文件的权限');
|
|
453
|
+
}
|
|
454
|
+
const sessionInfo = this.ctx.userSession.getSessionInfo();
|
|
455
|
+
|
|
456
|
+
const condition: any = {
|
|
457
|
+
created_by: sessionInfo.accountId,
|
|
458
|
+
status: 1
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
if (file_category) {
|
|
462
|
+
condition.file_category = file_category
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return await this.fileBD.getFilePage({
|
|
466
|
+
condition: condition,
|
|
467
|
+
columns: [
|
|
468
|
+
'id',
|
|
469
|
+
'file_key',
|
|
470
|
+
'file_name',
|
|
471
|
+
'file_size',
|
|
472
|
+
'file_type',
|
|
473
|
+
'file_suffix',
|
|
474
|
+
'storage_path',
|
|
475
|
+
'storage_url',
|
|
476
|
+
'file_category',
|
|
477
|
+
'created_at'
|
|
478
|
+
]
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
|
|
395
483
|
}
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import {Inject, Provide} from '@midwayjs/core';
|
|
2
|
-
import {SystemTables} from '@/models/SystemTables';
|
|
3
|
-
import {BaseService} from './base/BaseService';
|
|
4
|
-
import {CurdProService} from './curd/CurdProService';
|
|
5
|
-
import {GLOBAL_STATIC_CONFIG} from '@/libs/global-config/global-config';
|
|
6
|
-
import {CacheServiceFactory} from "@/service/base/cache/CacheServiceFactory";
|
|
7
|
-
import {CacheNameEnum} from "@/models/bizmodels";
|
|
8
|
-
|
|
9
|
-
@Provide()
|
|
10
|
-
export class SysAppService extends BaseService {
|
|
11
|
-
|
|
12
|
-
@Inject()
|
|
13
|
-
private curdProService: CurdProService;
|
|
14
|
-
|
|
15
|
-
@Inject()
|
|
16
|
-
private cacheServiceFactory: CacheServiceFactory;
|
|
17
|
-
|
|
18
|
-
private get sysAppDao(){
|
|
19
|
-
const { SystemDbName, SystemDbType } = GLOBAL_STATIC_CONFIG.getConfig();
|
|
20
|
-
return this.curdProService.getBbUtil(SystemDbName, SystemDbType, SystemTables.sys_app)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
private get sysAppPageDao(){
|
|
24
|
-
const { SystemDbName, SystemDbType } = GLOBAL_STATIC_CONFIG.getConfig();
|
|
25
|
-
return this.curdProService.getBbUtil(SystemDbName, SystemDbType, SystemTables.sys_app_page)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
async getSysAppPageOne({page_path,workbench_code}:{page_path: string,workbench_code: string}): Promise<any> {
|
|
30
|
-
if (!page_path || typeof page_path !== 'string') {
|
|
31
|
-
throw new Error('[getSysAppPageOne] page_path required');
|
|
32
|
-
}
|
|
33
|
-
if (!workbench_code || typeof workbench_code !== 'string') {
|
|
34
|
-
throw new Error('[getSysAppPageOne] workbench_code required');
|
|
35
|
-
}
|
|
36
|
-
return await this.cacheServiceFactory.getJsonObjectCache({
|
|
37
|
-
cacheKey: `${workbench_code}#${page_path}`,
|
|
38
|
-
cacheName: CacheNameEnum.GetSysAppPageOne,
|
|
39
|
-
getter: async () => {
|
|
40
|
-
return await this.sysAppPageDao.getUniqueOne({
|
|
41
|
-
condition: {page_path, workbench_code, deleted_at: 0}
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
async getSysAppOne(app_code: string): Promise<any> {
|
|
49
|
-
if (!app_code || typeof app_code !== 'string') {
|
|
50
|
-
throw new Error('[getSysAppOne] app_code required');
|
|
51
|
-
}
|
|
52
|
-
return await this.cacheServiceFactory.getJsonObjectCache({
|
|
53
|
-
cacheKey: app_code,
|
|
54
|
-
cacheName: CacheNameEnum.GetSysAppOne,
|
|
55
|
-
getter: async () => {
|
|
56
|
-
return await this.sysAppDao.getUniqueOne({
|
|
57
|
-
condition: {app_code, deleted_at: 0}
|
|
58
|
-
});
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
public deletePrivateField(parsedAppInfo: any){
|
|
64
|
-
if (!parsedAppInfo) {
|
|
65
|
-
return null;
|
|
66
|
-
}
|
|
67
|
-
const parsedAppInfo2: any = { ...parsedAppInfo };
|
|
68
|
-
delete parsedAppInfo2.created_at;
|
|
69
|
-
delete parsedAppInfo2.created_by;
|
|
70
|
-
delete parsedAppInfo2.workbench_code_array;
|
|
71
|
-
delete parsedAppInfo2.modified_at;
|
|
72
|
-
delete parsedAppInfo2.modified_by;
|
|
73
|
-
delete parsedAppInfo2.modified_desc;
|
|
74
|
-
delete parsedAppInfo2.std_crud_db;
|
|
75
|
-
delete parsedAppInfo2.std_crud_tbl;
|
|
76
|
-
return parsedAppInfo2;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
async removeSysAppOneCache(app_code: string) {
|
|
80
|
-
if (!app_code || typeof app_code !== 'string') {
|
|
81
|
-
throw new Error('[removeSysAppOneCache] app_code required');
|
|
82
|
-
}
|
|
83
|
-
return await this.cacheServiceFactory.removeItemCache({
|
|
84
|
-
cacheKey: app_code,
|
|
85
|
-
cacheName: CacheNameEnum.GetSysAppOne
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
1
|
+
import {Inject, Provide} from '@midwayjs/core';
|
|
2
|
+
import {SystemTables} from '@/models/SystemTables';
|
|
3
|
+
import {BaseService} from './base/BaseService';
|
|
4
|
+
import {CurdProService} from './curd/CurdProService';
|
|
5
|
+
import {GLOBAL_STATIC_CONFIG} from '@/libs/global-config/global-config';
|
|
6
|
+
import {CacheServiceFactory} from "@/service/base/cache/CacheServiceFactory";
|
|
7
|
+
import {CacheNameEnum} from "@/models/bizmodels";
|
|
8
|
+
|
|
9
|
+
@Provide()
|
|
10
|
+
export class SysAppService extends BaseService {
|
|
11
|
+
|
|
12
|
+
@Inject()
|
|
13
|
+
private curdProService: CurdProService;
|
|
14
|
+
|
|
15
|
+
@Inject()
|
|
16
|
+
private cacheServiceFactory: CacheServiceFactory;
|
|
17
|
+
|
|
18
|
+
private get sysAppDao(){
|
|
19
|
+
const { SystemDbName, SystemDbType } = GLOBAL_STATIC_CONFIG.getConfig();
|
|
20
|
+
return this.curdProService.getBbUtil(SystemDbName, SystemDbType, SystemTables.sys_app)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
private get sysAppPageDao(){
|
|
24
|
+
const { SystemDbName, SystemDbType } = GLOBAL_STATIC_CONFIG.getConfig();
|
|
25
|
+
return this.curdProService.getBbUtil(SystemDbName, SystemDbType, SystemTables.sys_app_page)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
async getSysAppPageOne({page_path,workbench_code}:{page_path: string,workbench_code: string}): Promise<any> {
|
|
30
|
+
if (!page_path || typeof page_path !== 'string') {
|
|
31
|
+
throw new Error('[getSysAppPageOne] page_path required');
|
|
32
|
+
}
|
|
33
|
+
if (!workbench_code || typeof workbench_code !== 'string') {
|
|
34
|
+
throw new Error('[getSysAppPageOne] workbench_code required');
|
|
35
|
+
}
|
|
36
|
+
return await this.cacheServiceFactory.getJsonObjectCache({
|
|
37
|
+
cacheKey: `${workbench_code}#${page_path}`,
|
|
38
|
+
cacheName: CacheNameEnum.GetSysAppPageOne,
|
|
39
|
+
getter: async () => {
|
|
40
|
+
return await this.sysAppPageDao.getUniqueOne({
|
|
41
|
+
condition: {page_path, workbench_code, deleted_at: 0}
|
|
42
|
+
});
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
async getSysAppOne(app_code: string): Promise<any> {
|
|
49
|
+
if (!app_code || typeof app_code !== 'string') {
|
|
50
|
+
throw new Error('[getSysAppOne] app_code required');
|
|
51
|
+
}
|
|
52
|
+
return await this.cacheServiceFactory.getJsonObjectCache({
|
|
53
|
+
cacheKey: app_code,
|
|
54
|
+
cacheName: CacheNameEnum.GetSysAppOne,
|
|
55
|
+
getter: async () => {
|
|
56
|
+
return await this.sysAppDao.getUniqueOne({
|
|
57
|
+
condition: {app_code, deleted_at: 0}
|
|
58
|
+
});
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
public deletePrivateField(parsedAppInfo: any){
|
|
64
|
+
if (!parsedAppInfo) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const parsedAppInfo2: any = { ...parsedAppInfo };
|
|
68
|
+
delete parsedAppInfo2.created_at;
|
|
69
|
+
delete parsedAppInfo2.created_by;
|
|
70
|
+
delete parsedAppInfo2.workbench_code_array;
|
|
71
|
+
delete parsedAppInfo2.modified_at;
|
|
72
|
+
delete parsedAppInfo2.modified_by;
|
|
73
|
+
delete parsedAppInfo2.modified_desc;
|
|
74
|
+
delete parsedAppInfo2.std_crud_db;
|
|
75
|
+
delete parsedAppInfo2.std_crud_tbl;
|
|
76
|
+
return parsedAppInfo2;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async removeSysAppOneCache(app_code: string) {
|
|
80
|
+
if (!app_code || typeof app_code !== 'string') {
|
|
81
|
+
throw new Error('[removeSysAppOneCache] app_code required');
|
|
82
|
+
}
|
|
83
|
+
return await this.cacheServiceFactory.removeItemCache({
|
|
84
|
+
cacheKey: app_code,
|
|
85
|
+
cacheName: CacheNameEnum.GetSysAppOne
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|