@waline/vercel 1.26.1 → 1.26.3

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": "@waline/vercel",
3
- "version": "1.26.1",
3
+ "version": "1.26.3",
4
4
  "description": "vercel server for waline comment system",
5
5
  "keywords": [
6
6
  "waline",
@@ -19,7 +19,7 @@
19
19
  "@koa/cors": "4.0.0",
20
20
  "akismet": "2.0.7",
21
21
  "deta": "1.1.0",
22
- "dompurify": "2.4.3",
22
+ "dompurify": "3.0.0",
23
23
  "dy-node-ip2region": "1.0.1",
24
24
  "fast-csv": "4.3.6",
25
25
  "form-data": "4.0.0",
@@ -32,7 +32,7 @@
32
32
  "markdown-it-sub": "1.0.0",
33
33
  "markdown-it-sup": "1.0.0",
34
34
  "mathjax-full": "3.2.2",
35
- "node-fetch": "2.6.8",
35
+ "node-fetch": "2.6.9",
36
36
  "nodemailer": "6.9.1",
37
37
  "nunjucks": "3.2.3",
38
38
  "phpass": "0.1.1",
@@ -42,8 +42,9 @@
42
42
  "think-logger3": "1.3.1",
43
43
  "think-model": "1.5.4",
44
44
  "think-model-mysql": "1.1.7",
45
+ "think-model-mysql2": "^2.0.0",
45
46
  "think-model-postgresql": "1.1.7",
46
- "think-model-sqlite": "1.3.0",
47
+ "think-model-sqlite": "1.3.1",
47
48
  "think-mongo": "2.2.1",
48
49
  "think-router-rest": "1.0.5",
49
50
  "thinkjs": "3.2.14",
@@ -1,5 +1,6 @@
1
1
  const { Console } = require('think-logger3');
2
2
  const Mysql = require('think-model-mysql');
3
+ const Mysql2 = require('think-model-mysql2');
3
4
  const Postgresql = require('think-model-postgresql');
4
5
 
5
6
  let Sqlite = class {};
@@ -141,7 +142,7 @@ exports.model = {
141
142
  },
142
143
 
143
144
  tidb: {
144
- handle: Mysql,
145
+ handle: Mysql2,
145
146
  dateStrings: true,
146
147
  host: TIDB_HOST || '127.0.0.1',
147
148
  port: TIDB_PORT || '4000',
@@ -2,7 +2,7 @@ const ip2region = require('dy-node-ip2region');
2
2
  const helper = require('think-helper');
3
3
  const preventMessage = 'PREVENT_NEXT_PROCESS';
4
4
 
5
- const regionSearch = ip2region.create();
5
+ const regionSearch = ip2region.create(process.env.IP2REGION_DB);
6
6
 
7
7
  module.exports = {
8
8
  prevent() {
@@ -70,7 +70,9 @@ module.exports = {
70
70
  }
71
71
  const { region } = result;
72
72
  const [, , province, city, isp] = region.split('|');
73
- const address = Array.from(new Set([province, city, isp]));
73
+ const address = Array.from(
74
+ new Set([province, city, isp].filter((v) => v))
75
+ );
74
76
 
75
77
  return address.slice(0, depth).join(' ');
76
78
  } catch (e) {