@next-core/brick-kit 2.149.1 → 2.150.0

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.esm.js CHANGED
@@ -1385,7 +1385,8 @@ function authenticate(newAuth) {
1385
1385
  loginFrom: newAuth.loginFrom,
1386
1386
  accessRule: newAuth.accessRule,
1387
1387
  isAdmin: newAuth.isAdmin,
1388
- csrfToken: newAuth.csrfToken
1388
+ csrfToken: newAuth.csrfToken,
1389
+ license: newAuth.license
1389
1390
  }); // re-init analytics to set user_id
1390
1391
 
1391
1392
  if (userAnalytics.initialized) {
@@ -12397,7 +12398,7 @@ class Router {
12397
12398
  // we say *page found*, otherwise, *page not found*.
12398
12399
 
12399
12400
  if (route && route.type !== "routes" || failed) {
12400
- var _this3$kernel$bootstr, _this3$kernel$bootstr2;
12401
+ var _this3$kernel$bootstr, _this3$kernel$bootstr2, _getAuth$license;
12401
12402
 
12402
12403
  main.length > 0 && mountTree(main, mountPoints.main);
12403
12404
  portal.length > 0 && mountTree(portal, mountPoints.portal);
@@ -12427,7 +12428,17 @@ class Router {
12427
12428
  path: locationContext.getCurrentMatch().path,
12428
12429
  username: getAuth().username,
12429
12430
  pageTitle: document.title
12430
- });
12431
+ }); // show app bar tips
12432
+
12433
+ var tipsDetail = [];
12434
+
12435
+ var getUnionKey = key => {
12436
+ var {
12437
+ org
12438
+ } = getAuth();
12439
+ return "".concat(key, ":").concat(org);
12440
+ };
12441
+
12431
12442
  var renderTime = performance.now() - renderStartTime;
12432
12443
  var {
12433
12444
  loadTime = 0,
@@ -12437,16 +12448,35 @@ class Router {
12437
12448
  if (currentApp.isBuildPush && loadTime > 0 && renderTime > loadTime) {
12438
12449
  var getSecond = time => Math.floor(time * 100) / 100;
12439
12450
 
12451
+ tipsDetail.push(_objectSpread({
12452
+ text: "\u60A8\u7684\u9875\u9762\u5B58\u5728\u6027\u80FD\u95EE\u9898, \u5F53\u524D\u9875\u9762\u6E32\u67D3\u65F6\u95F4 ".concat(getSecond(renderTime / 1000), " \u79D2, \u89C4\u5B9A\u9608\u503C\u4E3A: ").concat(getSecond(loadTime / 1000), " \u79D2, \u60A8\u5DF2\u8D85\u8FC7\u3002\u8BF7\u60A8\u9488\u5BF9\u8BE5\u9875\u9762\u8FDB\u884C\u6027\u80FD\u4F18\u5316!"),
12453
+ closable: false,
12454
+ isCenter: true,
12455
+ tipKey: getUnionKey("render"),
12456
+ backgroundColor: "#F3E27D"
12457
+ }, loadInfoPage ? {
12458
+ info: {
12459
+ label: "建议解决思路",
12460
+ url: loadInfoPage
12461
+ }
12462
+ } : {}));
12463
+ }
12464
+
12465
+ var validDaysLeft = (_getAuth$license = getAuth().license) === null || _getAuth$license === void 0 ? void 0 : _getAuth$license.validDaysLeft;
12466
+
12467
+ if (validDaysLeft && validDaysLeft <= 15 && getAuth().isAdmin) {
12468
+ tipsDetail.push({
12469
+ text: "\u79BBLicense\u8FC7\u671F\u8FD8\u6709".concat(validDaysLeft, "\u5929"),
12470
+ tipKey: getUnionKey("license"),
12471
+ closable: true,
12472
+ isCenter: true,
12473
+ backgroundColor: "#89B5F9"
12474
+ });
12475
+ }
12476
+
12477
+ if (tipsDetail.length !== 0) {
12440
12478
  window.dispatchEvent(new CustomEvent("app.bar.tips", {
12441
- detail: [_objectSpread({
12442
- text: "\u60A8\u7684\u9875\u9762\u5B58\u5728\u6027\u80FD\u95EE\u9898, \u5F53\u524D\u9875\u9762\u6E32\u67D3\u65F6\u95F4\u4E3A: ".concat(getSecond(renderTime / 1000), " \u79D2, \u89C4\u5B9A\u9608\u503C\u4E3A: ").concat(getSecond(loadTime / 1000), " \u79D2; \u60A8\u5DF2\u8D85\u8FC7, \u8BF7\u60A8\u9488\u5BF9\u8BE5\u9875\u9762\u8FDB\u884C\u6027\u80FD\u4F18\u5316!"),
12443
- closeable: false
12444
- }, loadInfoPage ? {
12445
- info: {
12446
- label: "查看详情",
12447
- url: loadInfoPage
12448
- }
12449
- } : {})]
12479
+ detail: tipsDetail
12450
12480
  }));
12451
12481
  } // analytics page_view event
12452
12482