Selaa lähdekoodia

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

- 在开发环境中为登录请求添加默认租户ID请求头
- 确保开发环境能够正常进行身份验证流程
yourname 2 viikkoa sitten
vanhempi
sitoutus
c1a9ae35df
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  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);