@dj1029/plugin-smart-sl 0.0.18 → 0.0.20

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.
@@ -1 +1 @@
1
- {"version":3,"file":"http-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/http-client.service.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,OAAO,+BAGX,CAAC;AA8HH,eAAe,OAAO,CAAA;AAGtB,qBACa,iBAAiB;IAC1B,OAAO,CAAC,aAAa,CAAC;;IAqBtB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAC,IAAI,CAAC,EAAE,GAAG;IAI1B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAK/B"}
1
+ {"version":3,"file":"http-client.service.d.ts","sourceRoot":"","sources":["../../src/lib/http-client.service.ts"],"names":[],"mappings":"AAWA,QAAA,MAAM,OAAO,+BAGX,CAAC;AA8HH,eAAe,OAAO,CAAA;AAGtB,qBACa,iBAAiB;IAC1B,OAAO,CAAC,aAAa,CAAC;;IAqBtB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAC,IAAI,CAAC,EAAE,GAAG;IAI1B,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAK/B"}
@@ -1,7 +1,12 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Injectable } from '@nestjs/common';
3
3
  import axios from 'axios';
4
- import errorCode from './errorCode.js';
4
+ const errorCode = {
5
+ '401': '认证失败,无法访问系统资源',
6
+ '403': '当前操作没有权限',
7
+ '404': '访问资源不存在',
8
+ 'default': '系统未知错误,请反馈给管理员'
9
+ };
5
10
  const service = axios.create({
6
11
  baseURL: 'https://www.antsfind.com:449', // 添加你的API基础URL
7
12
  timeout: 10000, // 设置超时时间
@@ -1 +1 @@
1
- {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,wBAAgB,cAAc;;;;;;;;;;;;;;;QAgC7B"}
1
+ {"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/lib/tool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,wBAAgB,cAAc;;;;;;;;;;;;;;;QAiC7B"}
package/dist/lib/tool.js CHANGED
@@ -5,7 +5,7 @@ import request from "./http-client.service.js";
5
5
  export function buildSmartTool() {
6
6
  return tool(async (input) => {
7
7
  try {
8
- // console.log("input ---------- ",input)
8
+ console.log("input ---------- ", input);
9
9
  // const httpClient = new HttpClientService();
10
10
  // const res = await httpClient.post('/login', input);
11
11
  // console.log("res ---------- ", res.data.token)
@@ -15,6 +15,7 @@ export function buildSmartTool() {
15
15
  method: 'post',
16
16
  data: input
17
17
  });
18
+ console.log("req ---------- ", req);
18
19
  return req.data.token;
19
20
  }
20
21
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dj1029/plugin-smart-sl",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",