浏览代码

🐛 fix(auth): 修复开发环境下的租户认证问题

- 在开发环境中为登录请求添加默认租户ID请求头
- 确保开发环境能够正常进行身份验证流程
yourname 2 周之前
父节点
当前提交
c1a9ae35df
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      web/src/client/admin/hooks/AuthProvider.tsx

+ 6 - 1
web/src/client/admin/hooks/AuthProvider.tsx

@@ -88,7 +88,12 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
           username,
           password
         }
-      })
+      }, 
+      import.meta.env.DEV ? {
+        headers: {
+          'X-Tenant-Id': '2'
+        } 
+      }: undefined )
       if (response.status !== 200) {
         const result = await response.json()
         throw new Error(result.message);