/** * @license * Copyright Stbui All Rights Reserved. * https://github.com/stbui/prophet */ import { useCallback } from 'react'; import { useHistory, useLocation } from 'react-router'; import useAuthProvider, { defaultAuthParams } from './useAuthProvider'; type Login = (params: any, pathName?: string) => Promise; /** * * @example * * import { useLogin } from '@stbui/prophet-core'; * * const LoginButton = () => { * const login = useLogin(); * const onClick = () => { * login({username:'stbui', password: '123456' }, '/user').then(()=>{ * console.log('ok') * }) * } * return