@alifd/chat 0.3.30-beta.2 → 0.3.30-beta.4

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/es/index.js CHANGED
@@ -31,4 +31,4 @@ export { default as RadioGroup } from './radio-group';
31
31
  export { default as CheckboxGroup } from './checkbox-group';
32
32
  export { default as Select } from './select';
33
33
  export { default as Flip } from './flip';
34
- export const version = '0.3.30-beta.2';
34
+ export const version = '0.3.30-beta.4';
@@ -21,7 +21,6 @@ import { __awaiter, __rest } from "tslib";
21
21
  import React, { useState, forwardRef, useRef, useEffect } from 'react';
22
22
  import { Select as NextSelect, ConfigProvider } from '@alifd/next';
23
23
  import cs from 'classnames';
24
- import axios from 'axios';
25
24
  import { PREFIX_DEFAULT, assignSubComponent } from '../utils';
26
25
  const PersonPicker = forwardRef((_a, ref) => {
27
26
  var { className, size = 'medium', defaultValue, readOnly } = _a, props = __rest(_a, ["className", "size", "defaultValue", "readOnly"]);
@@ -44,7 +43,7 @@ const PersonPicker = forwardRef((_a, ref) => {
44
43
  React.createElement("span", { className: "label-text" }, selectItem.label));
45
44
  };
46
45
  const fetchUserData = (keyword) => __awaiter(void 0, void 0, void 0, function* () {
47
- var _a, _b;
46
+ var _a;
48
47
  if (readOnly) {
49
48
  return;
50
49
  }
@@ -53,14 +52,21 @@ const PersonPicker = forwardRef((_a, ref) => {
53
52
  pageSize: (props === null || props === void 0 ? void 0 : props.pageSize) || 5
54
53
  };
55
54
  try {
56
- const response = yield axios.get('/_gw/employee360Service/searchEmpInfo.json', {
57
- params: queryParams,
55
+ // 构建查询字符串
56
+ const queryString = new URLSearchParams(queryParams).toString();
57
+ const url = `/_gw/employee360Service/searchEmpInfo.json?${queryString}`;
58
+ // 使用fetch替代axios
59
+ const response = yield fetch(url, {
60
+ method: 'GET',
58
61
  headers: {
59
62
  'X-Epaas-Api-Type': 'u',
60
63
  'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
61
- }
64
+ },
65
+ credentials: 'include',
66
+ mode: 'cors'
62
67
  });
63
- const newDataSource = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.map((item) => {
68
+ const responseData = yield response.json();
69
+ const newDataSource = (_a = responseData === null || responseData === void 0 ? void 0 : responseData.content) === null || _a === void 0 ? void 0 : _a.map((item) => {
64
70
  return Object.assign(Object.assign({}, item), { label: item.nickName, value: item.workNo });
65
71
  });
66
72
  setDataSource(newDataSource);
package/lib/index.js CHANGED
@@ -68,4 +68,4 @@ var select_1 = require("./select");
68
68
  Object.defineProperty(exports, "Select", { enumerable: true, get: function () { return tslib_1.__importDefault(select_1).default; } });
69
69
  var flip_1 = require("./flip");
70
70
  Object.defineProperty(exports, "Flip", { enumerable: true, get: function () { return tslib_1.__importDefault(flip_1).default; } });
71
- exports.version = '0.3.30-beta.2';
71
+ exports.version = '0.3.30-beta.4';
@@ -23,7 +23,6 @@ const tslib_1 = require("tslib");
23
23
  const react_1 = tslib_1.__importStar(require("react"));
24
24
  const next_1 = require("@alifd/next");
25
25
  const classnames_1 = tslib_1.__importDefault(require("classnames"));
26
- const axios_1 = tslib_1.__importDefault(require("axios"));
27
26
  const utils_1 = require("../utils");
28
27
  const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
29
28
  var { className, size = 'medium', defaultValue, readOnly } = _a, props = tslib_1.__rest(_a, ["className", "size", "defaultValue", "readOnly"]);
@@ -46,7 +45,7 @@ const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
46
45
  react_1.default.createElement("span", { className: "label-text" }, selectItem.label));
47
46
  };
48
47
  const fetchUserData = (keyword) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
49
- var _a, _b;
48
+ var _a;
50
49
  if (readOnly) {
51
50
  return;
52
51
  }
@@ -55,14 +54,21 @@ const PersonPicker = (0, react_1.forwardRef)((_a, ref) => {
55
54
  pageSize: (props === null || props === void 0 ? void 0 : props.pageSize) || 5
56
55
  };
57
56
  try {
58
- const response = yield axios_1.default.get('/_gw/employee360Service/searchEmpInfo.json', {
59
- params: queryParams,
57
+ // 构建查询字符串
58
+ const queryString = new URLSearchParams(queryParams).toString();
59
+ const url = `/_gw/employee360Service/searchEmpInfo.json?${queryString}`;
60
+ // 使用fetch替代axios
61
+ const response = yield fetch(url, {
62
+ method: 'GET',
60
63
  headers: {
61
64
  'X-Epaas-Api-Type': 'u',
62
65
  'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8'
63
- }
66
+ },
67
+ credentials: 'include',
68
+ mode: 'cors'
64
69
  });
65
- const newDataSource = (_b = (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.map((item) => {
70
+ const responseData = yield response.json();
71
+ const newDataSource = (_a = responseData === null || responseData === void 0 ? void 0 : responseData.content) === null || _a === void 0 ? void 0 : _a.map((item) => {
66
72
  return Object.assign(Object.assign({}, item), { label: item.nickName, value: item.workNo });
67
73
  });
68
74
  setDataSource(newDataSource);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alifd/chat",
3
- "version": "0.3.30-beta.2",
3
+ "version": "0.3.30-beta.4",
4
4
  "description": "A configurable component library for chat built on React.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",