@antv/dumi-theme-antv 0.6.4-beta.1 → 0.6.4-beta.3

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.
@@ -536,18 +536,12 @@ export var Header = function Header(props) {
536
536
  document.body.removeChild(script);
537
537
  }
538
538
  }
539
- return function () {
540
- if (script) {
541
- document.body.removeChild(script);
542
- }
543
- };
544
539
  }, [isInternalUser, isLinksShow]);
545
540
 
546
541
  // 当 petercat.show 为 true 且以下任一条件满足时展示 Petercat Assistant:
547
542
  // 1. 外部用户访问
548
543
  // 2. 不显示 links 研发小蜜
549
- var isPetercatShow = (petercat === null || petercat === void 0 ? void 0 : petercat.show) && (isBoolean(isInternalUser) && !isInternalUser || !isLinksShow);
550
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HeaderComponent, Object.assign({}, headerProps, props)), isPetercatShow && /*#__PURE__*/React.createElement(Assistant, {
544
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(HeaderComponent, Object.assign({}, headerProps, props)), (petercat === null || petercat === void 0 ? void 0 : petercat.show) && (isBoolean(isInternalUser) && !isInternalUser || !isLinksShow) && /*#__PURE__*/React.createElement(Assistant, {
551
545
  token: petercat === null || petercat === void 0 ? void 0 : petercat.token,
552
546
  apiDomain: "https://api.petercat.ai"
553
547
  }));
@@ -35,7 +35,7 @@ var fetchWithTimeout = /*#__PURE__*/function () {
35
35
  case 7:
36
36
  response = _context.sent;
37
37
  clearTimeout(timeoutId);
38
- return _context.abrupt("return", response);
38
+ return _context.abrupt("return", response.json());
39
39
  case 12:
40
40
  _context.prev = 12;
41
41
  _context.t0 = _context["catch"](4);
@@ -74,7 +74,12 @@ export var determineUserType = /*#__PURE__*/function () {
74
74
  timeout = 5000;
75
75
  _context2.prev = 4;
76
76
  _context2.next = 7;
77
- return fetchWithTimeout(url, {}, timeout);
77
+ return fetchWithTimeout(url, {
78
+ method: 'GET',
79
+ headers: {
80
+ 'Content-Type': 'application/json; charset=utf-8'
81
+ }
82
+ }, timeout);
78
83
  case 7:
79
84
  res = _context2.sent;
80
85
  if ((res === null || res === void 0 ? void 0 : res.buserviceErrorCode) === 'USER_NOT_LOGIN') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antv/dumi-theme-antv",
3
- "version": "0.6.4-beta.1",
3
+ "version": "0.6.4-beta.3",
4
4
  "description": "AntV website theme based on dumi2.",
5
5
  "keywords": [
6
6
  "dumi",
@@ -129,8 +129,7 @@
129
129
  "react-dom": ">=16.9.0"
130
130
  },
131
131
  "publishConfig": {
132
- "access": "public",
133
- "tag": "beta"
132
+ "access": "public"
134
133
  },
135
134
  "authors": [
136
135
  "dumi",