befly 1.2.5 → 1.2.7

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/main.js +3 -2
  2. package/package.json +2 -2
package/main.js CHANGED
@@ -359,10 +359,11 @@ class Befly {
359
359
  const api = this.apiRoutes.get(apiPath);
360
360
 
361
361
  // 接口不存在
362
- if (!api)
362
+ if (!api) {
363
363
  return Response.json(RNo('接口不存在'), {
364
364
  headers: corsOptions.headers
365
365
  });
366
+ }
366
367
 
367
368
  const authHeader = req.headers.get('authorization');
368
369
  if (authHeader && authHeader.startsWith('Bearer ')) {
@@ -446,7 +447,7 @@ class Befly {
446
447
 
447
448
  // 登录验证 auth 有3种值 分别为 true、false、['admin', 'user']
448
449
  if (api.auth === true && !ctx.user.id) {
449
- return Response.json(RNo('未登录'), {
450
+ return Response.json(RNo('未登录', {}, { login: 'no' }), {
450
451
  headers: corsOptions.headers
451
452
  });
452
453
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "befly",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "Buma - 为 Bun 专属打造的 API 接口框架核心引擎",
5
5
  "type": "module",
6
6
  "private": false,
@@ -49,5 +49,5 @@
49
49
  "README.md",
50
50
  "vitest.config.js"
51
51
  ],
52
- "gitHead": "a84c6e80313a7485fee34aee89d1359d7cf6100f"
52
+ "gitHead": "f29cb8eb5c855fb4f183617c110ad8c49c4b3497"
53
53
  }