oak-domain 5.1.13 → 5.1.15

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.
@@ -69,6 +69,7 @@ export declare abstract class CascadeStore<ED extends EntityDict & BaseEntityDic
69
69
  protected preProcessDataCreated<T extends keyof ED>(entity: T, data: ED[T]['Create']['data']): void;
70
70
  protected preProcessDataUpdated(action: string, data: Record<string, any>, async?: true): void;
71
71
  judgeRelation(entity: keyof ED, attr: string): string | 1 | 2 | string[] | 0 | -1;
72
+ private tryMergeModi;
72
73
  /**
73
74
  * 和具体的update过程无关的例程放在这里,包括对later动作的处理、对oper的记录以及对record的收集等
74
75
  * @param entity
@@ -1051,6 +1051,118 @@ class CascadeStore extends RowStore_1.RowStore {
1051
1051
  judgeRelation(entity, attr) {
1052
1052
  return (0, relation_1.judgeRelation)(this.storageSchema, entity, attr);
1053
1053
  }
1054
+ async tryMergeModi(entity, operation, context, ids, option) {
1055
+ const { action, data, filter, id: operId } = operation;
1056
+ const [upsertModi] = await this.selectAbjointRowAsync('modi', {
1057
+ data: {
1058
+ id: 1,
1059
+ data: 1,
1060
+ action: 1,
1061
+ },
1062
+ filter: {
1063
+ targetEntity: entity,
1064
+ iState: 'active',
1065
+ filter: ids.length > 0 ? {
1066
+ id: {
1067
+ $in: ids,
1068
+ },
1069
+ } : {
1070
+ id: ids[0],
1071
+ },
1072
+ },
1073
+ sorter: [
1074
+ {
1075
+ $attr: {
1076
+ $$createAt$$: 1,
1077
+ },
1078
+ $direction: 'desc',
1079
+ }
1080
+ ],
1081
+ indexFrom: 0,
1082
+ count: 1,
1083
+ }, context, option);
1084
+ if (upsertModi) {
1085
+ const { data: data2, id: id2, action: action2 } = upsertModi;
1086
+ if (action === 'remove') {
1087
+ // 之前的都不做数
1088
+ if (action2 === 'create') {
1089
+ // 对冲掉
1090
+ return {
1091
+ id: await (0, uuid_1.generateNewIdAsync)(),
1092
+ action: 'remove',
1093
+ data: {},
1094
+ filter: {
1095
+ id: upsertModi.id,
1096
+ },
1097
+ };
1098
+ }
1099
+ else {
1100
+ // 直接把这个改成删除
1101
+ (0, assert_1.default)(action2 !== 'remove');
1102
+ return {
1103
+ id: await (0, uuid_1.generateNewIdAsync)(),
1104
+ action: 'update',
1105
+ data: {
1106
+ action,
1107
+ data,
1108
+ },
1109
+ filter: {
1110
+ id: upsertModi.id,
1111
+ },
1112
+ };
1113
+ }
1114
+ }
1115
+ else {
1116
+ // 是update,直接把原来的data覆盖掉
1117
+ if (action !== action2 && process.env.NODE_ENV === 'development') {
1118
+ // 这种情况感觉是不会发生的
1119
+ console.warn('发生了同一行数据的modi的action不一致,请注意查看');
1120
+ }
1121
+ return {
1122
+ id: 'dummy',
1123
+ action: 'update',
1124
+ data: {
1125
+ data: Object.assign({}, data2, data),
1126
+ },
1127
+ filter: {
1128
+ id: id2,
1129
+ }
1130
+ };
1131
+ }
1132
+ }
1133
+ // 说明没有已有的modi,必须要创建新的,此时应当在option中有相应的parentEntity/Id
1134
+ const { modiParentEntity, modiParentId } = option;
1135
+ (0, assert_1.default)(modiParentEntity && modiParentId);
1136
+ return {
1137
+ id: 'dummy',
1138
+ action: 'create',
1139
+ data: {
1140
+ id: operId,
1141
+ targetEntity: entity,
1142
+ entity: modiParentEntity,
1143
+ entityId: modiParentId,
1144
+ action,
1145
+ data,
1146
+ iState: 'active',
1147
+ filter: ids.length > 0 ? {
1148
+ id: {
1149
+ $in: ids,
1150
+ },
1151
+ } : {
1152
+ id: ids[0],
1153
+ },
1154
+ modiEntity$modi: {
1155
+ id: 'dummy',
1156
+ action: 'create',
1157
+ data: await Promise.all(ids.map(async (id) => ({
1158
+ id: await (0, uuid_1.generateNewIdAsync)(),
1159
+ entity: entity,
1160
+ entityId: id,
1161
+ }))),
1162
+ }
1163
+ },
1164
+ };
1165
+ }
1054
1166
  /**
1055
1167
  * 和具体的update过程无关的例程放在这里,包括对later动作的处理、对oper的记录以及对record的收集等
1056
1168
  * @param entity
@@ -1282,137 +1394,18 @@ class CascadeStore extends RowStore_1.RowStore {
1282
1394
  if (data) {
1283
1395
  this.preProcessDataUpdated(action, data, true);
1284
1396
  }
1285
- if (option.modiParentEntity && !['modi', 'modiEntity'].includes(entity)) {
1286
- // 延时更新,变成对modi的插入
1287
- // 变成对modi的插入
1288
- // 优化,这里如果是对同一个targetEntity反复update,则变成对最后一条create/update的modi进行update,以避免发布文章这样的需求时产生过多的modi
1289
- let modiUpsert;
1290
- if (action === 'update') {
1291
- // 如果action本身是update,且没有实际update属性,这里可以忽略
1292
- const updateAttrCount = Object.keys(data).length;
1293
- if (updateAttrCount === 0) {
1294
- return {};
1295
- }
1296
- // 尝试和当前targetEntity的最后一条create/update进行合并,优化modi的条数
1297
- const upsertModis = await this.selectAbjointRowAsync('modi', {
1298
- data: {
1299
- id: 1,
1300
- data: 1,
1301
- action: 1,
1302
- },
1303
- filter: {
1304
- targetEntity: entity,
1305
- entity: option.modiParentEntity,
1306
- entityId: option.modiParentId,
1307
- iState: 'active',
1308
- filter: ids.length > 0 ? {
1309
- id: {
1310
- $in: ids,
1311
- },
1312
- } : filter,
1313
- },
1314
- sorter: [
1315
- {
1316
- $attr: {
1317
- $$createAt$$: 1,
1318
- },
1319
- $direction: 'desc',
1320
- }
1321
- ],
1322
- indexFrom: 0,
1323
- count: 1,
1324
- }, context, option);
1325
- if (upsertModis.length > 0) {
1326
- const { data: originData, id: originId, action } = upsertModis[0];
1327
- if (['create', 'update'].includes(action)) {
1328
- modiUpsert = {
1329
- id: 'dummy',
1330
- action: 'update',
1331
- data: {
1332
- data: Object.assign({}, originData, data),
1333
- },
1334
- filter: {
1335
- id: originId,
1336
- }
1337
- };
1338
- }
1339
- }
1340
- }
1341
- if (!modiUpsert) {
1342
- modiUpsert = {
1343
- id: 'dummy',
1344
- action: 'create',
1345
- data: {
1346
- id: operId,
1347
- targetEntity: entity,
1348
- entity: option.modiParentEntity,
1349
- entityId: option.modiParentId,
1350
- action,
1351
- data,
1352
- iState: 'active',
1353
- filter,
1354
- },
1355
- };
1356
- if (ids.length > 0) {
1357
- modiUpsert.data.modiEntity$modi = {
1358
- id: 'dummy',
1359
- action: 'create',
1360
- data: await Promise.all(ids.map(async (id) => ({
1361
- id: await (0, uuid_1.generateNewIdAsync)(),
1362
- entity: entity,
1363
- entityId: id,
1364
- }))),
1365
- };
1366
- }
1367
- }
1397
+ const createModi = async () => {
1398
+ const modiOperation = await this.tryMergeModi(entity, operation, context, ids, option);
1368
1399
  const closeRootMode = context.openRootMode();
1369
- await this.cascadeUpdateAsync('modi', modiUpsert, context, option);
1400
+ await this.cascadeUpdateAsync('modi', modiOperation, context, option);
1370
1401
  closeRootMode();
1371
1402
  return {
1372
1403
  modi: {
1373
1404
  ['create']: 1,
1374
1405
  },
1375
1406
  };
1376
- }
1377
- else {
1378
- const createOper = async () => {
1379
- if (!option.dontCreateOper && !['oper', 'operEntity', 'modiEntity', 'modi', 'log'].includes(entity) && ids.length > 0) {
1380
- // 按照框架要求生成Oper和OperEntity这两个内置的对象
1381
- (0, assert_1.default)(operId);
1382
- const operatorId = context.getCurrentUserId(true);
1383
- const createOper = {
1384
- id: 'dummy',
1385
- action: 'create',
1386
- data: {
1387
- id: operId,
1388
- action,
1389
- data,
1390
- targetEntity: entity,
1391
- bornAt,
1392
- operatorId,
1393
- operEntity$oper: {
1394
- id: 'dummy',
1395
- action: 'create',
1396
- data: await Promise.all(ids.map(async (ele) => ({
1397
- id: await (0, uuid_1.generateNewIdAsync)(),
1398
- entityId: ele,
1399
- entity: entity,
1400
- })))
1401
- },
1402
- filter: {
1403
- id: { $in: ids },
1404
- },
1405
- logId: entity === 'log' ? undefined : option.logId,
1406
- undoData,
1407
- },
1408
- };
1409
- const closeRootMode = context.openRootMode();
1410
- await this.cascadeUpdateAsync('oper', createOper, context, {
1411
- dontCollect: !option.logId, // 如果是在创建log,则把oper收集回去
1412
- });
1413
- closeRootMode();
1414
- }
1415
- };
1407
+ };
1408
+ const saveRecordAndCreateOper = async () => {
1416
1409
  if (action === 'remove') {
1417
1410
  if (!option.dontCollect) {
1418
1411
  context.saveOpRecord(entity, {
@@ -1443,17 +1436,70 @@ class CascadeStore extends RowStore_1.RowStore {
1443
1436
  });
1444
1437
  }
1445
1438
  }
1446
- else {
1447
- return {};
1448
- }
1449
1439
  }
1450
- await this.updateAbjointRowAsync(entity, operation, context, option);
1451
- await createOper();
1440
+ if (!option.dontCreateOper && !['oper', 'operEntity', 'modiEntity', 'modi', 'log'].includes(entity) && ids.length > 0) {
1441
+ // 按照框架要求生成Oper和OperEntity这两个内置的对象
1442
+ (0, assert_1.default)(operId);
1443
+ const operatorId = context.getCurrentUserId(true);
1444
+ const createOper = {
1445
+ id: 'dummy',
1446
+ action: 'create',
1447
+ data: {
1448
+ id: operId,
1449
+ action,
1450
+ data,
1451
+ targetEntity: entity,
1452
+ bornAt,
1453
+ operatorId,
1454
+ operEntity$oper: {
1455
+ id: 'dummy',
1456
+ action: 'create',
1457
+ data: await Promise.all(ids.map(async (ele) => ({
1458
+ id: await (0, uuid_1.generateNewIdAsync)(),
1459
+ entityId: ele,
1460
+ entity: entity,
1461
+ })))
1462
+ },
1463
+ filter: {
1464
+ id: { $in: ids },
1465
+ },
1466
+ logId: entity === 'log' ? undefined : option.logId,
1467
+ undoData,
1468
+ },
1469
+ };
1470
+ const closeRootMode = context.openRootMode();
1471
+ await this.cascadeUpdateAsync('oper', createOper, context, {
1472
+ dontCollect: !option.logId, // 如果是在创建log,则把oper收集回去
1473
+ });
1474
+ closeRootMode();
1475
+ }
1452
1476
  return {
1453
1477
  [entity]: {
1454
1478
  [action]: ids.length,
1455
1479
  }
1456
1480
  };
1481
+ };
1482
+ if (action !== 'remove' && Object.keys(data).length === 0) {
1483
+ if (action !== 'update') {
1484
+ // 如果不是update,这里还是记一条oper
1485
+ return saveRecordAndCreateOper();
1486
+ }
1487
+ return {};
1488
+ }
1489
+ if (option.modiParentEntity && !['modi', 'modiEntity'].includes(entity)) {
1490
+ // 延时更新,变成对modi的操作
1491
+ return createModi();
1492
+ }
1493
+ else {
1494
+ const count = await this.updateAbjointRowAsync(entity, operation, context, option);
1495
+ if (count === ids.length) {
1496
+ return await saveRecordAndCreateOper();
1497
+ }
1498
+ else {
1499
+ // 如果没有更新到行,说明这些数据还在modi当中
1500
+ (0, assert_1.default)(count === 0, 'update成功的行数只能为id所在行数或者0');
1501
+ return await createModi();
1502
+ }
1457
1503
  }
1458
1504
  }
1459
1505
  }
@@ -352,12 +352,47 @@ class RelationAuth {
352
352
  const dealWithData = (rows) => {
353
353
  // 这里如果entity指向不同的实体,一般出现这样的查询,则其权限应当不由这条deduce路径处理
354
354
  // 同上,如果找到的行数大于1行,说明deduce路径上的对象不确定,也暂不处理 by Xc 20230725
355
- if (rows.length > 1 || rows.length === 0) {
355
+ if (rows.length > 1) {
356
356
  if (process.env.NODE_ENV === 'development') {
357
357
  console.warn(`进行deduce推导时找到了${rows.length}行${entity}数据`);
358
358
  }
359
359
  return entityFilters;
360
360
  }
361
+ else if (rows.length === 0) {
362
+ // 说明没有找到行,这时候有一种可能是modi。这时候只能假设是指定id更新了,其它情况很难处理。by Xc
363
+ if (filter.id) {
364
+ // 用modi对应的entity/entityId来判定
365
+ const modies = context.select('modi', {
366
+ data: {
367
+ id: 1,
368
+ data: 1,
369
+ entity: 1,
370
+ entityId: 1,
371
+ },
372
+ filter: {
373
+ filter,
374
+ }
375
+ }, {});
376
+ const getModiEntity = (modies) => {
377
+ if (modies[0]) {
378
+ const { entity, entityId } = modies[0];
379
+ entityFilters.push({
380
+ entity: entity,
381
+ filter: {
382
+ id: entityId,
383
+ },
384
+ actions: ['update'],
385
+ });
386
+ }
387
+ return entityFilters;
388
+ };
389
+ if (modies instanceof Promise) {
390
+ return modies.then((modies2) => getModiEntity(modies2));
391
+ }
392
+ return getModiEntity(modies);
393
+ }
394
+ return entityFilters;
395
+ }
361
396
  const { entity: deducedEntity, entityId: deducedEntityId } = rows[0];
362
397
  if (!deducedEntity || !deducedEntityId) {
363
398
  // 这种情况会出现在前台缓存里
@@ -801,6 +836,7 @@ class RelationAuth {
801
836
  */
802
837
  findActionAuthsOnNode(node, context) {
803
838
  const { entity, filter, action, userRelations } = node;
839
+ (0, assert_1.default)(filter);
804
840
  const deducedEntityFilters2 = this.getDeducedEntityFilters(entity, filter, [action], context);
805
841
  /**
806
842
  * 搜索判定是否允许自建对象,自建的条件是 path = '',destEntity === entity
@@ -352,11 +352,11 @@ class TriggerExecutor {
352
352
  const trigger = this.triggerNameMap[name];
353
353
  (0, assert_1.default)(trigger && trigger.when === 'commit');
354
354
  // assert(ids.length > 0);
355
- const { fn } = trigger;
355
+ const { fn, cleanTriggerDataBySelf } = trigger;
356
356
  const closeRoot = trigger.asRoot && context.openRootMode();
357
357
  try {
358
358
  const callback = await fn({ ids }, context, option);
359
- if (trigger.strict === 'makeSure' && ids.length) {
359
+ if (trigger.strict === 'makeSure' && ids.length && !cleanTriggerDataBySelf) {
360
360
  // 这里开root模式,否则还可能有权限问题
361
361
  const closeRoot2 = context.openRootMode();
362
362
  try {
@@ -485,67 +485,10 @@ class TriggerExecutor {
485
485
  }
486
486
  async checkpoint(timestamp) {
487
487
  let result = 0;
488
- for (const entity of this.volatileEntities) {
489
- const filter = {
490
- [Entity_1.TriggerUuidAttribute]: {
491
- $exists: true,
492
- },
493
- [Entity_1.UpdateAtAttribute]: {
494
- $lt: timestamp,
495
- }
496
- };
497
- const context = this.contextBuilder();
498
- await context.begin();
499
- try {
500
- const rows = await context.select(entity, {
501
- data: {
502
- id: 1,
503
- },
504
- filter,
505
- }, {
506
- includedDeleted: true,
507
- dontCollect: true,
508
- });
509
- if (rows.length > 0) {
510
- // 要用id来再锁一次,不然会锁住filter的范围,影响并发性
511
- // by Xc 20240314,在haina-busi和haina-cn数据sync过程中发现这个问题
512
- const rows2 = await context.select(entity, {
513
- data: {
514
- id: 1,
515
- [Entity_1.TriggerDataAttribute]: 1,
516
- [Entity_1.TriggerUuidAttribute]: 1,
517
- },
518
- filter: {
519
- id: {
520
- $in: rows.map(ele => ele.id),
521
- },
522
- },
523
- }, {
524
- includedDeleted: true,
525
- dontCollect: true,
526
- forUpdate: 'skip locked', // 如果加不上锁就下次再处理,或者有可能应用自己在处理
527
- });
528
- const grouped = (0, lodash_1.groupBy)(rows2, Entity_1.TriggerUuidAttribute);
529
- for (const uuid in grouped) {
530
- const rs = grouped[uuid];
531
- const { [Entity_1.TriggerDataAttribute]: triggerData } = rs[0];
532
- const { name, cxtStr, option } = triggerData;
533
- await context.initialize(JSON.parse(cxtStr), true);
534
- await this.execVolatileTrigger(entity, name, rs.map(ele => ele.id), context, option);
535
- }
536
- }
537
- await context.commit();
538
- result += rows.length;
539
- }
540
- catch (err) {
541
- if (!(err instanceof types_1.OakPartialSuccess)) {
542
- await context.rollback();
543
- this.logger.error(`error in checkpoint on entity 「${entity}」`, err);
544
- }
545
- else {
546
- await context.commit();
547
- this.logger.error(`error in checkpoint on entity 「${entity}」`, err);
548
- }
488
+ for (const name in this.triggerNameMap) {
489
+ const trigger = this.triggerNameMap[name];
490
+ if (trigger && trigger.when === 'commit') {
491
+ result += await this.independentCheckPoint(name, timestamp);
549
492
  }
550
493
  }
551
494
  return result;
@@ -25,7 +25,6 @@ type FilterPart<A extends string, F extends Object | undefined> = {
25
25
  export type SelectOption = {
26
26
  dontCollect?: boolean;
27
27
  blockTrigger?: true;
28
- obscure?: boolean;
29
28
  forUpdate?: true | 'skip locked' | 'nowait';
30
29
  includedDeleted?: true;
31
30
  ignoreAttrMiss?: true;
@@ -150,7 +150,7 @@ export declare function isStringExpression<A>(expression: any): expression is St
150
150
  export declare function isAggrExpression<A>(expression: any): expression is AggrExpression<A>;
151
151
  export declare function isExpression<A>(expression: any): expression is Expression<A>;
152
152
  export declare function opMultipleParams(op: string): boolean;
153
- export declare function execOp(op: string, params: any, obscure?: boolean): ExpressionConstant;
153
+ export declare function execOp(op: string, params: any): ExpressionConstant;
154
154
  /**
155
155
  * 检查一个表达式,并分析其涉及到的属性
156
156
  * @param expression
@@ -136,10 +136,7 @@ function opMultipleParams(op) {
136
136
  '$round', '$floor', '$ceil', '$$max', '$$min', '$$sum', '$$avg', '$$count'].includes(op);
137
137
  }
138
138
  exports.opMultipleParams = opMultipleParams;
139
- function execOp(op, params, obscure) {
140
- if (obscure && (params === undefined || params.includes(undefined))) {
141
- return true;
142
- }
139
+ function execOp(op, params) {
143
140
  switch (op) {
144
141
  case '$gt': {
145
142
  return params[0] > params[1];
@@ -40,6 +40,7 @@ interface TriggerCrossTxn<ED extends EntityDict & BaseEntityDict, Cxt extends As
40
40
  when: 'commit';
41
41
  strict?: 'takeEasy' | 'makeSure';
42
42
  cs?: true;
43
+ cleanTriggerDataBySelf?: true;
43
44
  singleton?: true;
44
45
  grouped?: true;
45
46
  fn: (event: {
@@ -78,8 +78,7 @@ class SimpleConnector {
78
78
  ;
79
79
  async parseAspectResult(response) {
80
80
  if (response.status > 299) {
81
- const err = new types_1.OakServerProxyException(`网络请求返回status是${response.status}`);
82
- throw this.makeException(err);
81
+ throw new types_1.OakServerProxyException(`网络请求返回status是${response.status}`);
83
82
  }
84
83
  const message = response.headers.get('oak-message');
85
84
  const responseType = response.headers.get('Content-Type') ||
@@ -120,14 +119,10 @@ class SimpleConnector {
120
119
  }
121
120
  catch (err) {
122
121
  // fetch返回异常一定是网络异常
123
- let exception = err;
124
122
  if (err instanceof types_1.OakRequestTimeoutException) {
125
- exception = new types_1.OakNetworkException(`接口请求超时`);
123
+ throw new types_1.OakNetworkException(`接口请求超时`);
126
124
  }
127
- else {
128
- exception = new types_1.OakNetworkException(`接口请求时发生网络异常`);
129
- }
130
- throw this.makeException(exception);
125
+ throw new types_1.OakNetworkException(`接口请求时发生网络异常`);
131
126
  }
132
127
  return this.parseAspectResult(response);
133
128
  }
@@ -149,18 +144,13 @@ class SimpleConnector {
149
144
  response = await this.fetchWithTimeout(this.serverSubscribePointUrl, {}, this.timeout);
150
145
  }
151
146
  catch (err) {
152
- let exception = err;
153
147
  if (err instanceof types_1.OakRequestTimeoutException) {
154
- exception = new types_1.OakNetworkException(`接口请求超时`);
155
- }
156
- else {
157
- exception = new types_1.OakNetworkException(`接口请求时发生网络异常`);
148
+ throw new types_1.OakNetworkException(`接口请求超时`);
158
149
  }
159
- throw this.makeException(exception);
150
+ throw new types_1.OakNetworkException(`接口请求时发生网络异常`);
160
151
  }
161
152
  if (response.status > 299) {
162
- const err = new types_1.OakServerProxyException(`网络请求返回status是${response.status}`);
163
- throw this.makeException(err);
153
+ throw new types_1.OakServerProxyException(`网络请求返回status是${response.status}`);
164
154
  }
165
155
  const message = response.headers.get('oak-message');
166
156
  const responseType = response.headers.get('Content-Type') ||
@@ -246,28 +236,29 @@ class SimpleConnector {
246
236
  return {};
247
237
  }
248
238
  async fetchWithTimeout(url, options, timeout = 5000) {
249
- if (typeof AbortController === 'undefined') {
250
- return global.fetch(url, options);
251
- }
252
- const controller = new AbortController();
253
- const signal = controller.signal;
254
- // 设置超时
255
- const timeoutId = setTimeout(() => {
256
- controller.abort();
257
- }, timeout);
258
- // 发起 fetch 请求并传递 signal
259
- return global.fetch(url, Object.assign({}, options, { signal }))
260
- .then(response => {
261
- clearTimeout(timeoutId); // 如果请求成功,清除超时
262
- return response;
263
- })
264
- .catch(error => {
265
- clearTimeout(timeoutId); // 如果请求失败,清除超时
266
- if (error.name === 'AbortError') {
267
- throw new types_1.OakRequestTimeoutException();
268
- }
269
- throw error; // 其他错误
270
- });
239
+ return global.fetch(url, options);
240
+ // if (typeof AbortController === 'undefined' || timeout === 0) {
241
+ // return global.fetch(url, options);
242
+ // }
243
+ // const controller = new AbortController();
244
+ // const signal = controller.signal;
245
+ // // 设置超时
246
+ // const timeoutId = setTimeout(() => {
247
+ // controller.abort();
248
+ // }, timeout);
249
+ // // 发起 fetch 请求并传递 signal
250
+ // return global.fetch(url, Object.assign({}, options, { signal }))
251
+ // .then(response => {
252
+ // clearTimeout(timeoutId); // 如果请求成功,清除超时
253
+ // return response;
254
+ // })
255
+ // .catch(error => {
256
+ // clearTimeout(timeoutId); // 如果请求失败,清除超时
257
+ // if (error.name === 'AbortError') {
258
+ // throw new OakRequestTimeoutException();
259
+ // }
260
+ // throw error; // 其他错误
261
+ // });
271
262
  }
272
263
  }
273
264
  exports.default = SimpleConnector;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oak-domain",
3
- "version": "5.1.13",
3
+ "version": "5.1.15",
4
4
  "author": {
5
5
  "name": "XuChang"
6
6
  },