@qse/edu-scripts 1.13.9 → 1.13.10

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # 更新日志
2
2
 
3
+ ## 1.13.10 (2023-08-10)
4
+
5
+ - fix: 清理 mock 的 console.log,优化提示效果
6
+
3
7
  ## 1.13.9 (2023-08-10)
4
8
 
5
9
  - feat: 增加 mock 功能
@@ -27,14 +27,13 @@ var setupMock = debounce(function setupMock2() {
27
27
  console.error(chalk.red(`Mock file ${file} error: ${e.message}`));
28
28
  }
29
29
  }
30
- console.log("🚀 ~ file: index.js:47 ~ setupMock ~ mockCache:", mockCache);
31
30
  }, 100);
32
31
  function mockMiddlewave(req, res, next) {
33
32
  const { method, path } = req;
34
33
  const key = `${method.toUpperCase()} ${path}`;
35
34
  const mock = mockCache[key];
36
- console.log(chalk.green(`Mock: ${key}`));
37
35
  if (mock) {
36
+ console.log(chalk.green(`Mock: ${key}`));
38
37
  if (typeof mock === "function") {
39
38
  mock(req, res, next);
40
39
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qse/edu-scripts",
3
- "version": "1.13.9",
3
+ "version": "1.13.10",
4
4
  "author": "Kinoko",
5
5
  "license": "MIT",
6
6
  "description": "教育工程化基础框架",
@@ -35,7 +35,6 @@ const setupMock = debounce(function setupMock() {
35
35
  console.error(chalk.red(`Mock file ${file} error: ${e.message}`))
36
36
  }
37
37
  }
38
- console.log('🚀 ~ file: index.js:47 ~ setupMock ~ mockCache:', mockCache)
39
38
  }, 100)
40
39
 
41
40
  /**
@@ -45,8 +44,8 @@ function mockMiddlewave(req, res, next) {
45
44
  const { method, path } = req
46
45
  const key = `${method.toUpperCase()} ${path}`
47
46
  const mock = mockCache[key]
48
- console.log(chalk.green(`Mock: ${key}`))
49
47
  if (mock) {
48
+ console.log(chalk.green(`Mock: ${key}`))
50
49
  if (typeof mock === 'function') {
51
50
  mock(req, res, next)
52
51
  } else {