@ywfe/fe-tools 1.2.1-beta.6 → 1.2.1-beta.8

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@ywfe/fe-tools",
4
- "version": "1.2.1-beta.6",
4
+ "version": "1.2.1-beta.8",
5
5
  "description": "工具函数库",
6
6
  "main": "./lib/ywfe-tools.cjs",
7
7
  "module": "./lib/ywfe-tools.esm.js",
@@ -1,16 +1,24 @@
1
+ import {request} from './index'
1
2
  // Ctrl-S保存代码
2
3
  interface userInput {
3
- userInput?:string,
4
- rules?:string,
4
+ userInput?: string;
5
+ rules?: string;
5
6
  }
6
- async function userInputToJson({input}:{input:userInput}){
7
- const {userInput, rules} = input
8
- //const res = await fetools.request({
9
- //input:{
10
- //url:"https://fc-typechat.ywwl.com/userInputToJson",
11
- //method:"GET"
12
- //}
13
- //})
14
- return "2"
7
+ async function userInputToJson({ input }: { input: userInput }) {
8
+ console.log("input", input);
9
+ const res: { message: string; success: boolean; data: any } =
10
+ await request({
11
+ input: {
12
+ url: "https://fc-typechat.ywwl.com/userInputToJson",
13
+ method: "GET",
14
+ params: input,
15
+ },
16
+ });
17
+ if (res.success) {
18
+ const result = res.data;
19
+ return result.success ? result.data : result;
20
+ } else {
21
+ return res.success ? res.data : res;
22
+ }
15
23
  }
16
24
  export default userInputToJson