@ywfe/fe-tools 1.2.1-beta.7 → 1.2.1-beta.8
Sign up to get free protection for your applications and to get access to all the features.
- package/index.ts +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/ywfe-tools.cjs +29 -22
- package/lib/ywfe-tools.cjs.map +1 -1
- package/lib/ywfe-tools.esm.js +29 -22
- package/lib/ywfe-tools.esm.js.map +1 -1
- package/package.json +1 -1
- package/userInputToJson.ts +18 -11
package/package.json
CHANGED
package/userInputToJson.ts
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
import {request} from './index'
|
2
2
|
// Ctrl-S保存代码
|
3
3
|
interface userInput {
|
4
|
-
userInput?:string
|
5
|
-
rules?:string
|
4
|
+
userInput?: string;
|
5
|
+
rules?: string;
|
6
6
|
}
|
7
|
-
async function userInputToJson({input}:{input:userInput}){
|
8
|
-
|
9
|
-
const res
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
+
}
|
16
23
|
}
|
17
24
|
export default userInputToJson
|