@cpzxrobot/sdk 1.3.121 → 1.3.122
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/aiform_gateway.ts +7 -10
- package/dist/aiform_gateway.js +7 -10
- package/package.json +1 -1
package/aiform_gateway.ts
CHANGED
|
@@ -77,29 +77,26 @@ export class AiformGateway extends Object {
|
|
|
77
77
|
* 上传表格图片提炼模板提示词
|
|
78
78
|
* POST /api/v2/aiform/template/upload
|
|
79
79
|
* @param templateId 模板ID(可选,与factoryId二选一)
|
|
80
|
-
* @param file 图片文件
|
|
81
80
|
* @param factoryId 工厂ID(可选,与templateId二选一)
|
|
82
81
|
*/
|
|
83
|
-
uploadTemplateImage: async (templateId: number | null,
|
|
82
|
+
uploadTemplateImage: async (templateId: number | null, factoryId?: number): Promise<any> => {
|
|
84
83
|
const axios = await this.context.ready;
|
|
85
84
|
|
|
86
85
|
if (!templateId && !factoryId) {
|
|
87
86
|
throw new Error('模板ID和工厂ID至少需要传一个');
|
|
88
87
|
}
|
|
89
88
|
|
|
90
|
-
const
|
|
91
|
-
formData.append('file', file);
|
|
89
|
+
const data: any = {};
|
|
92
90
|
if (templateId) {
|
|
93
|
-
|
|
91
|
+
data.templateId = templateId;
|
|
94
92
|
}
|
|
95
93
|
if (factoryId) {
|
|
96
|
-
|
|
94
|
+
data.factoryId = factoryId;
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
return axios.
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}
|
|
97
|
+
return axios.upload(`/api/v2/aiform/template/upload`,{
|
|
98
|
+
title: "请选择表格图片",
|
|
99
|
+
data: data
|
|
103
100
|
}).then((res) => {
|
|
104
101
|
if (res.data.code !== 200) {
|
|
105
102
|
throw new Error(res.data.message || '上传图片失败');
|
package/dist/aiform_gateway.js
CHANGED
|
@@ -65,26 +65,23 @@ class AiformGateway extends Object {
|
|
|
65
65
|
* 上传表格图片提炼模板提示词
|
|
66
66
|
* POST /api/v2/aiform/template/upload
|
|
67
67
|
* @param templateId 模板ID(可选,与factoryId二选一)
|
|
68
|
-
* @param file 图片文件
|
|
69
68
|
* @param factoryId 工厂ID(可选,与templateId二选一)
|
|
70
69
|
*/
|
|
71
|
-
uploadTemplateImage: (templateId,
|
|
70
|
+
uploadTemplateImage: (templateId, factoryId) => __awaiter(this, void 0, void 0, function* () {
|
|
72
71
|
const axios = yield this.context.ready;
|
|
73
72
|
if (!templateId && !factoryId) {
|
|
74
73
|
throw new Error('模板ID和工厂ID至少需要传一个');
|
|
75
74
|
}
|
|
76
|
-
const
|
|
77
|
-
formData.append('file', file);
|
|
75
|
+
const data = {};
|
|
78
76
|
if (templateId) {
|
|
79
|
-
|
|
77
|
+
data.templateId = templateId;
|
|
80
78
|
}
|
|
81
79
|
if (factoryId) {
|
|
82
|
-
|
|
80
|
+
data.factoryId = factoryId;
|
|
83
81
|
}
|
|
84
|
-
return axios.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
82
|
+
return axios.upload(`/api/v2/aiform/template/upload`, {
|
|
83
|
+
title: "请选择表格图片",
|
|
84
|
+
data: data
|
|
88
85
|
}).then((res) => {
|
|
89
86
|
if (res.data.code !== 200) {
|
|
90
87
|
throw new Error(res.data.message || '上传图片失败');
|