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 +2 -1
- package/README.md +1 -1
- package/bin/serve.js +7 -3
- package/bin/website-htmls/pages/appStore/index.html +1 -1
- package/nodejs/animation/index.js +1 -1
- package/nodejs/cmdlog/index.js +1 -1
- package/nodejs/disk/index.js +1 -1
- package/nodejs/format/index.js +1 -1
- package/nodejs/json/index.js +1 -1
- package/nodejs/logform/index.js +1 -1
- package/nodejs/reader/index.js +1 -1
- package/nodejs/throttle/index.js +1 -1
- package/package.json +1 -1
- package/web/XMLHttpRequest/index.js +1 -1
- package/web/animation/index.js +1 -1
- package/web/format/index.js +1 -1
- package/web/json/index.js +1 -1
- package/web/onReady/index.js +1 -1
- package/web/performChunk/index.js +1 -1
- package/web/reader/index.js +1 -1
- package/web/style/index.js +1 -1
- package/web/throttle/index.js +1 -1
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
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
|
package/nodejs/cmdlog/index.js
CHANGED
package/nodejs/disk/index.js
CHANGED
package/nodejs/format/index.js
CHANGED
package/nodejs/json/index.js
CHANGED
package/nodejs/logform/index.js
CHANGED
package/nodejs/reader/index.js
CHANGED
package/nodejs/throttle/index.js
CHANGED
package/package.json
CHANGED
package/web/animation/index.js
CHANGED
package/web/format/index.js
CHANGED
package/web/json/index.js
CHANGED
package/web/onReady/index.js
CHANGED
package/web/reader/index.js
CHANGED
package/web/style/index.js
CHANGED
package/web/throttle/index.js
CHANGED