bjchy-udg-sdk 1.8.13 → 1.8.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bjchy-udg-sdk",
3
- "version": "1.8.13",
3
+ "version": "1.8.14",
4
4
  "description": "Universal Data Gateway SDK - 跨端统一数据访问(微信小程序 / Web / Node.js),API 兼容微信云开发",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
@@ -23,6 +23,5 @@
23
23
  "type": "git",
24
24
  "url": "https://git.weixin.qq.com/wangzhongsheng/UDGV1.git",
25
25
  "directory": "sdk"
26
- },
27
- "dependencies": {}
26
+ }
28
27
  }
package/src/ai.js CHANGED
@@ -32,7 +32,7 @@ class AiNamespace {
32
32
 
33
33
  /** 上传并解析 DOCX/XLSX。省略 model 时选择网关的文档默认模型。 */
34
34
  async analyzeDocument(options) {
35
- const model = options?.model
35
+ const model = options === undefined || options === null ? undefined : options.model
36
36
  if (model !== undefined && (typeof model !== 'string' || !model.trim())) {
37
37
  throw new UdgRequestError({ errorCode: 'INVALID_PARAM', errorMessage: 'model 必须是非空的模型 ID 或别名' })
38
38
  }
package/src/request.js CHANGED
@@ -237,7 +237,7 @@ function uploadViaWx(url, filePath, fields, headers, timeout) {
237
237
  success(res) {
238
238
  let json = res.data
239
239
  if (typeof json === 'string') {
240
- try { json = JSON.parse(json) } catch { json = null }
240
+ try { json = JSON.parse(json) } catch (e) { json = null }
241
241
  }
242
242
  resolve({ status: res.statusCode, json })
243
243
  },