@ywfe/fe-tools 1.2.1-beta.32 → 1.2.1-beta.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -8726,6 +8726,7 @@ function request(_a) {
8726
8726
  };
8727
8727
  prefix = getBasePath();
8728
8728
  requestUrl = isValidURL(input.url) ? input.url : "".concat(prefix).concat(input.url);
8729
+ console.log('requestUrl', requestUrl, isValidURL(input.url));
8729
8730
  fetchOption = {
8730
8731
  method: method,
8731
8732
  headers: {
@@ -8744,13 +8745,11 @@ function request(_a) {
8744
8745
  response = _c.sent();
8745
8746
  if (!response.ok) {
8746
8747
  message = "An error has occured: ".concat(response.status);
8747
- console.log('req result', message);
8748
8748
  return [2 /*return*/, { success: false, message: message }];
8749
8749
  }
8750
8750
  return [4 /*yield*/, response.json()];
8751
8751
  case 2:
8752
8752
  result = _c.sent();
8753
- console.log('req result', result);
8754
8753
  return [2 /*return*/, result];
8755
8754
  }
8756
8755
  });
@@ -8759,28 +8758,21 @@ function request(_a) {
8759
8758
 
8760
8759
  function userInputToJson(_a) {
8761
8760
  return __awaiter(this, arguments, void 0, function (_b) {
8762
- var res, result;
8761
+ var res;
8763
8762
  var input = _b.input;
8764
8763
  return __generator(this, function (_c) {
8765
8764
  switch (_c.label) {
8766
- case 0:
8767
- console.log("input", input);
8768
- return [4 /*yield*/, request({
8769
- input: {
8770
- url: "https://fc-typechat.ywwl.com/userInputToJson",
8771
- method: "GET",
8772
- params: input,
8773
- },
8774
- })];
8765
+ case 0: return [4 /*yield*/, request({
8766
+ input: {
8767
+ url: "https://fc-typechat.ywwl.com/userInputToJson",
8768
+ method: "GET",
8769
+ params: input,
8770
+ },
8771
+ })];
8775
8772
  case 1:
8776
8773
  res = _c.sent();
8777
- if (res.success) {
8778
- result = res.data;
8779
- return [2 /*return*/, result.success ? result.data : result];
8780
- }
8781
- else {
8782
- return [2 /*return*/, res.success ? res.data : res];
8783
- }
8774
+ console.log('userINput1', res);
8775
+ return [2 /*return*/, res];
8784
8776
  }
8785
8777
  });
8786
8778
  });
@@ -8790,15 +8782,12 @@ function userInputToJson(_a) {
8790
8782
  function JSON2String(_a) {
8791
8783
  var input = _a.input;
8792
8784
  var data = input.data;
8793
- var result = { content: '' };
8794
8785
  try {
8795
8786
  var str = JSON.stringify(data);
8796
- result.content = '```json' + str + 'json```';
8797
- return result;
8787
+ return '```json' + str + 'json```';
8798
8788
  }
8799
8789
  catch (error) {
8800
- result.content = '```json' + '{}' + 'json```';
8801
- return result;
8790
+ return '```json' + '{}' + 'json```';
8802
8791
  }
8803
8792
  }
8804
8793