abler-api 1.0.20 → 1.0.22

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/README.md CHANGED
@@ -26,6 +26,14 @@ API服务启动时检查前置条件
26
26
 
27
27
  ### 更新日志
28
28
 
29
+ #### 1.0.22
30
+
31
+ - extractToken Bug修复
32
+
33
+ #### 1.0.21
34
+
35
+ - 随abler-db更新版本
36
+
29
37
  #### 1.0.20
30
38
 
31
39
  - preconditions.checkAll(saveFile) 增加参数saveFile,指定保存检查结果的文件,若未指定或值为 undefined,则为保持和老版本兼容自动设置为 "../log/preconditions",若值为 “”, 则不保存文件
@@ -147,8 +147,8 @@ class preconditions$2 {
147
147
  /**
148
148
  * 初始化数据库连接
149
149
  */
150
- static async initDb(dbSql) {
151
- return await initDb(dbSql);
150
+ static async initDb() {
151
+ return await initDb();
152
152
  }
153
153
 
154
154
  /**
@@ -228,9 +228,9 @@ async function checkRedis() {
228
228
  // console.log(`checkRedis done:`);
229
229
  // console.log(redis);
230
230
  }
231
- async function initDb(dbSql) {
231
+ async function initDb() {
232
232
  try {
233
- dbUtil$1.config(conf$3, err$1, dbSql);
233
+ dbUtil$1.config(conf$3, err$1);
234
234
  } catch (e) {
235
235
  if (e.reason === 'bad decrypt') {
236
236
  e = new Error(t_f$3("解密数据库密码(%s)失败", conf$3.dbconn.dbpwd));
@@ -685,12 +685,14 @@ class apiUtil$2 {
685
685
  token = params.token; //向后兼容
686
686
  delete params.token;
687
687
  } else {
688
- // 如果没有token,则返回错误
689
- console.log(errCfg.TOKEN_NEEDED);
690
- if (res) {
691
- res.send(errCfg.ERROR(errCfg.TOKEN_NEEDED));
692
- } else if (!noErr) {
693
- throw errCfg.TOKEN_NEEDED;
688
+ if (!noErr) {
689
+ // 如果没有token,则返回错误
690
+ console.log(errCfg.TOKEN_NEEDED);
691
+ if (res) {
692
+ res.send(errCfg.ERROR(errCfg.TOKEN_NEEDED));
693
+ } else {
694
+ throw errCfg.TOKEN_NEEDED;
695
+ }
694
696
  }
695
697
  }
696
698
  }
package/package.json CHANGED
@@ -1,46 +1,47 @@
1
- {
2
- "name": "abler-api",
3
- "version": "1.0.20",
4
- "description": "API服务相关工具",
5
- "main": "./dist/cjs/pp-util.js",
6
- "-module": "./dist/es/pp-util.js",
7
- "scripts": {
8
- "build": "npx rollup -c rollup.config.js",
9
- "postbuild": "node ..\\postbuild.js",
10
- "test": "echo \"Skip tests for this package\" && exit 0"
11
- },
12
- "files": [
13
- "dist"
14
- ],
15
- "author": "peng_peng",
16
- "license": "ISC",
17
- "dependencies": {
18
- "abler-db": "^1.0.20",
19
- "abler-i18n": "^1.0.2",
20
- "abler-messenger": "^1.0.18",
21
- "abler-net": "^1.0.5",
22
- "abler-util": "^1.0.4",
23
- "basic-auth": "^2.0.1",
24
- "node-cron": "^3.0.1",
25
- "proxy-agent": "6.5.0",
26
- "q": "^1.5.1"
27
- },
28
- "devDependencies": {
29
- "@babel/core": "^7.18.5",
30
- "@babel/eslint-parser": "^7.18.2",
31
- "@babel/plugin-transform-runtime": "^7.18.0",
32
- "@babel/preset-env": "^7.18.2",
33
- "@babel/runtime": "^7.18.0",
34
- "@rollup/plugin-babel": "^5.3.1",
35
- "@rollup/plugin-commonjs": "^22.0.0",
36
- "@rollup/plugin-eslint": "^8.0.2",
37
- "@rollup/plugin-node-resolve": "^13.3.0",
38
- "@typescript-eslint/eslint-plugin": "^5.25.0",
39
- "@typescript-eslint/parser": "^5.25.0",
40
- "eslint": "^8.16.0",
41
- "eslint-plugin-react": "^7.30.0",
42
- "rollup-plugin-filesize": "^10.0.0",
43
- "rollup-plugin-json": "^4.0.0",
44
- "rollup-plugin-terser": "^7.0.2"
45
- }
46
- }
1
+ {
2
+ "name": "abler-api",
3
+ "version": "1.0.22",
4
+ "description": "API服务相关工具",
5
+ "main": "./dist/cjs/pp-util.js",
6
+ "-module": "./dist/es/pp-util.js",
7
+ "scripts": {
8
+ "build": "npx rollup -c rollup.config.js",
9
+ "postbuild": "node ..\\postbuild.js",
10
+ "test": "echo \"Skip tests for this package\" && exit 0"
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "author": "peng_peng",
16
+ "license": "ISC",
17
+ "dependencies": {
18
+ "abler-db": "^1.0.27",
19
+ "abler-i18n": "^1.0.2",
20
+ "abler-messenger": "^1.0.20",
21
+ "abler-net": "^1.0.6",
22
+ "abler-util": "^1.0.6",
23
+ "basic-auth": "^2.0.1",
24
+ "node-cron": "^3.0.1",
25
+ "proxy-agent": "6.5.0",
26
+ "q": "^1.5.1"
27
+ },
28
+ "devDependencies": {
29
+ "@babel/core": "^7.18.5",
30
+ "@babel/eslint-parser": "^7.18.2",
31
+ "@babel/plugin-transform-runtime": "^7.18.0",
32
+ "@babel/preset-env": "^7.18.2",
33
+ "@babel/runtime": "^7.18.0",
34
+ "@rollup/plugin-babel": "^5.3.1",
35
+ "@rollup/plugin-commonjs": "^22.0.0",
36
+ "@rollup/plugin-eslint": "^8.0.2",
37
+ "@rollup/plugin-node-resolve": "^13.3.0",
38
+ "@typescript-eslint/eslint-plugin": "^5.25.0",
39
+ "@typescript-eslint/parser": "^5.25.0",
40
+ "eslint": "^8.16.0",
41
+ "eslint-plugin-react": "^7.30.0",
42
+ "rollup-plugin-filesize": "^10.0.0",
43
+ "rollup-plugin-json": "^4.0.0",
44
+ "rollup-plugin-terser": "^7.0.2"
45
+ },
46
+ "gitHead": "45a3feb5ff29d29806aeabf0a0fa0c4506bd6505"
47
+ }