oipage 1.6.0-beta.1 → 1.6.0-beta.2

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 CHANGED
@@ -109,7 +109,7 @@ v1.5.0:
109
109
  1、优化run命令日志打印
110
110
  - 新增功能
111
111
  1、开发服务器 / 应用市场
112
- * 聊天工具
112
+ * 群聊天
113
113
  * 图片编辑器
114
114
  * 图片转PDF
115
115
  2、API功能(Node.js)
@@ -121,6 +121,7 @@ v1.6.0:
121
121
  - 修复bug
122
122
  1、修复logform在run下无法正常使用问题
123
123
  (关联issue: https://github.com/oi-contrib/OIPage/issues/4 )
124
+ 2、修复服务器错误修改XHR等请求数据问题
124
125
  - 优化改造
125
126
  1、命令行帮助打印更可读
126
127
  - 新增功能
package/README.md CHANGED
@@ -78,7 +78,7 @@ oipage-cli serve -p 8080
78
78
 
79
79
  为了方便日常使用,内置了一个应用市场网站,比如有如下功能:
80
80
 
81
- ### 群聊贴
81
+ ### 群聊天
82
82
 
83
83
  <img src="./snipping/chart.png" />
84
84
 
package/bin/serve.js CHANGED
@@ -51,6 +51,10 @@ module.exports = function (config) {
51
51
  // 如果存在且是文件
52
52
  else if (existsSync(filePath) && !lstatSync(filePath).isDirectory()) {
53
53
 
54
+ // 判断是否是请求而无需进一步解析
55
+ // 2025年12月5日 于南京
56
+ let isXHR = headers["sec-fetch-dest"] === "empty";
57
+
54
58
  let dotName = /\./.test(filePath) ? filePath.match(/\.([^.]+)$/)[1] : "";
55
59
  let fileType = mineTypes[dotName]; // 文件类型
56
60
  let fileInfo = statSync(filePath);
@@ -72,7 +76,7 @@ module.exports = function (config) {
72
76
  if (lastModified <= ifModifiedSince) {
73
77
  response.writeHead('304', responseHeader);
74
78
  response.end();
75
- console.log("<i> \x1b[1m\x1b[32m[" + name + "] Cache File: " + url + "\x1b[0m " + new Date().toLocaleString() + "\x1b[33m\x1b[1m 304\x1b[0m");
79
+ console.log("<i> \x1b[1m\x1b[32m[" + name + "] Cache File: " + url + "\x1b[0m " + new Date().toLocaleString() + "\x1b[33m\x1b[1m 304" + (isXHR ? " 请求" : "") + "\x1b[0m");
76
80
  return;
77
81
  }
78
82
  }
@@ -109,7 +113,7 @@ module.exports = function (config) {
109
113
 
110
114
  sendType = "Read";
111
115
  response.writeHead('200', responseHeader);
112
- response.write(resolveImport(source, fileType !== "application/javascript"));
116
+ response.write(isXHR ? source : resolveImport(source, fileType !== "application/javascript"));
113
117
  response.end();
114
118
  }
115
119
 
@@ -123,7 +127,7 @@ module.exports = function (config) {
123
127
  createReadStream(filePath).pipe(response);
124
128
  }
125
129
 
126
- console.log("<i> \x1b[1m\x1b[32m[" + name + "] " + sendType + " File: " + url + '\x1b[0m ' + new Date().toLocaleString());
130
+ console.log("<i> \x1b[1m\x1b[32m[" + name + "] " + sendType + " File: " + url + '\x1b[0m ' + new Date().toLocaleString() + "\x1b[33m\x1b[1m" + (isXHR ? " 请求" : "") + "\x1b[0m");
127
131
  }
128
132
 
129
133
  // 否则就是404
@@ -6,7 +6,7 @@
6
6
  <li z-on:click.prevent="goto" tag="chart">
7
7
  <img src="./images/chart.png" />
8
8
  <h2>
9
- 群聊贴
9
+ 群聊天
10
10
  </h2>
11
11
  </li>
12
12
  <li z-on:click="goto" tag="image-editor">
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.6.0-beta.1
2
+ * animation of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * cmdlog of OIPage v1.6.0-beta.1
2
+ * cmdlog of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * disk of OIPage v1.6.0-beta.1
2
+ * disk of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * format of OIPage v1.6.0-beta.1
2
+ * format of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.6.0-beta.1
2
+ * json of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {reader} = require("../reader/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * logform of OIPage v1.6.0-beta.1
2
+ * logform of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  const {linelog} = require("../cmdlog/index.js");
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.6.0-beta.1
2
+ * reader of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.6.0-beta.1
2
+ * throttle of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oipage",
3
- "version": "1.6.0-beta.1",
3
+ "version": "1.6.0-beta.2",
4
4
  "description": "前端网页或应用快速开发助手,包括开发服务器、辅助命令、实用API等",
5
5
  "sideEffects": false,
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * XMLHttpRequest of OIPage v1.6.0-beta.1
2
+ * XMLHttpRequest of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * animation of OIPage v1.6.0-beta.1
2
+ * animation of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * format of OIPage v1.6.0-beta.1
2
+ * format of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
package/web/json/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * json of OIPage v1.6.0-beta.1
2
+ * json of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
  import {reader} from "../reader/index.js";
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * onReady of OIPage v1.6.0-beta.1
2
+ * onReady of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * performChunk of OIPage v1.6.0-beta.1
2
+ * performChunk of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * reader of OIPage v1.6.0-beta.1
2
+ * reader of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * style of OIPage v1.6.0-beta.1
2
+ * style of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * throttle of OIPage v1.6.0-beta.1
2
+ * throttle of OIPage v1.6.0-beta.2
3
3
  * git+https://github.com/oi-contrib/OIPage.git
4
4
  */
5
5