diff --git a/src/apis/user.ts b/src/apis/user.ts index f68779d..3060349 100644 --- a/src/apis/user.ts +++ b/src/apis/user.ts @@ -9,6 +9,19 @@ export const login = (data = {}) => { }); }; +// 多机构用户选择机构后二次登录(/login 返回 600 + 机构列表时使用) +export const loginByOrg = (tempToken: string, orgId: string | number) => { + return http.post( + "/login_token_user", + { tempToken, orgId }, + { + headers: { + "content-type": HTTP_CONTENT_TYPE.APPLICATION_FORM_URLENCODED, + }, + }, + ); +}; + // 登出 export const logout = () => { return http.post("/logout"); diff --git a/src/components/init-password.tsx b/src/components/init-password.tsx index ca9ee12..351ccee 100644 --- a/src/components/init-password.tsx +++ b/src/components/init-password.tsx @@ -13,6 +13,8 @@ import { import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Spinner } from "@/components/ui/spinner"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; +import { TriangleAlert } from "lucide-react"; import { initUserPassword } from "@/apis/user"; import { useMutation } from "@tanstack/react-query"; import { toast } from "sonner"; @@ -69,10 +71,17 @@ export function InitPassword() {