@kevisual/router 0.0.2 → 0.0.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.
Files changed (2) hide show
  1. package/dist/index.js +2 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -5869,7 +5869,7 @@ class QueryRouter {
5869
5869
  if (!message?.path) {
5870
5870
  return Promise.resolve({ code: 404, body: 'Not found path' });
5871
5871
  }
5872
- const { path, key, payload = {}, ...query } = message;
5872
+ const { path, key = '', payload = {}, ...query } = message;
5873
5873
  ctx = ctx || {};
5874
5874
  ctx.query = { ...ctx.query, ...query, ...payload };
5875
5875
  ctx.state = {};
@@ -6096,6 +6096,7 @@ class Server {
6096
6096
  res.setHeader('Content-Type', 'application/json; charset=utf-8');
6097
6097
  if (cors) {
6098
6098
  res.setHeader('Access-Control-Allow-Origin', cors?.origin || '*'); // 允许所有域名的请求访问,可以根据需要设置具体的域名
6099
+ res.setHeader('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization');
6099
6100
  res.setHeader('Access-Control-Allow-Methods', 'GET, POST');
6100
6101
  if (req.method === 'OPTIONS') {
6101
6102
  res.end();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@kevisual/router",
4
- "version": "0.0.2",
4
+ "version": "0.0.3",
5
5
  "description": "",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -36,7 +36,7 @@
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
39
- "url": "https://github.com/abearxiong/kevisual-router.git"
39
+ "url": "git+https://github.com/abearxiong/kevisual-router.git"
40
40
  },
41
41
  "dependencies": {
42
42
  "ws": "^8.18.0"
@@ -44,4 +44,4 @@
44
44
  "publishConfig": {
45
45
  "access": "public"
46
46
  }
47
- }
47
+ }