diff --git a/src/client/index.ts b/src/client/index.ts index b774b75..5552541 100644 --- a/src/client/index.ts +++ b/src/client/index.ts @@ -12,6 +12,8 @@ export interface SchemaAuth { /** @default "123456" */ password?: string + /** @default false */ + remember?: boolean /** @default "demo" */ username?: string } @@ -518,7 +520,7 @@ export class Api< }, params: RequestParams = {} ) => - this.request({ + this.request({ path: `/api/v1/admin/users`, method: 'GET', query: query, diff --git a/src/pages/Login/index.tsx b/src/pages/Login/index.tsx index 235b63e..ef89509 100644 --- a/src/pages/Login/index.tsx +++ b/src/pages/Login/index.tsx @@ -14,13 +14,15 @@ const LoginForm: React.FC = () => { const [searchParams] = useSearchParams() const [username, setUsername] = useState('demo') const [password, setPassword] = useState('123456') + const [remember, setRemember] = useState(false) const { run: login } = useRequest( async () => { const from = searchParams.get('from') ?? '/' return Backend.auth.v1AuthLoginCreate( { username, - password + password, + remember }, { redirect_url: `${DOMAIN_HOST}${from}` @@ -82,9 +84,22 @@ const LoginForm: React.FC = () => { /> + - -