@ywfe/fe-tools 1.2.1-beta.32 → 1.2.1-beta.33
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/userInputToJson.d.ts +5 -1
- package/lib/ywfe-tools.cjs +11 -19
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +11 -19
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/lib/ywfe-tools.umd.js +2 -2
- package/lib/ywfe-tools.umd.js.map +1 -1
- package/package.json +1 -1
- package/request.ts +1 -2
- package/userInputToJson.ts +3 -7
package/lib/ywfe-tools.esm.js
CHANGED
@@ -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
|
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
|
-
|
8768
|
-
|
8769
|
-
|
8770
|
-
|
8771
|
-
|
8772
|
-
|
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
|
-
|
8778
|
-
|
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
|
});
|