mm_ip 1.0.2 → 1.0.4

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": "mm_ip",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "用于管理IP名单,可设置白名单、黑名单和IP检查,查询IP请求次数、频率等。",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,6 +21,6 @@
21
21
  "author": "qww",
22
22
  "license": "ISC",
23
23
  "dependencies": {
24
- "mm_expand": "^1.9.7"
24
+ "mm_expand": "^2.0.0"
25
25
  }
26
26
  }
package/test.js CHANGED
@@ -4,13 +4,6 @@
4
4
 
5
5
  const { Ip } = require('./index.js');
6
6
 
7
- // 创建自定义日志器
8
- const logger = {
9
- info: (...args) => console.log('[INFO]', ...args),
10
- warn: (...args) => console.log('[WARN]', ...args),
11
- error: (...args) => console.log('[ERROR]', ...args)
12
- };
13
-
14
7
  // 创建IP管理实例(启用高频拉黑和违规记录)
15
8
  const ip_manager = new Ip({
16
9
  max_white: 5,
@@ -26,8 +19,6 @@ const ip_manager = new Ip({
26
19
  violation_auto_black: true // 违规次数超限自动拉黑
27
20
  });
28
21
 
29
- // 设置自定义日志器
30
- ip_manager.setup(logger);
31
22
 
32
23
  console.log('=== IP管理模块测试开始 ===\n');
33
24
 
@@ -207,7 +198,6 @@ setTimeout(() => {
207
198
  max_white: 3,
208
199
  max_black: 3
209
200
  });
210
- persistent_ip.setup(logger);
211
201
 
212
202
  // 添加测试数据
213
203
  console.log('添加测试数据到持久化实例:');
@@ -258,7 +248,6 @@ setTimeout(() => {
258
248
  const loaded_ip = new Ip({
259
249
  dir: './cache/ip'
260
250
  });
261
- loaded_ip.setup(logger);
262
251
 
263
252
  console.log('加载后数据统计:');
264
253
  console.log('白名单数量:', loaded_ip.getAllWhite().length);