Novices Performing Miracles

    @gaopeng123/rc-login-module
    TypeScript icon, indicating that this package has built-in type declarations

    0.4.7 • Public • Published

    rc-login-module

    登录组件

    Usage

    import * as React from 'react';
    import * as ReactDOM from 'react-dom';
    import {RcLoginModule} from "@gaopeng123/rc-login-module";
    
    const App = () => {
        return (
            <div>
                <RcLoginModule
                    id={`test`}
                    user="userId"
                    password="password"
                    publicKey=""
                    method="GET"
                    url="/assets/login.json"
                    mainStyle={{backgroundImage: 'url(./assets/background.jpg)'}}
                    bodyStyle={{right: '200px;'}}
                    keeplogged={true}
                    title="食堂管理系统"
                />
            </div>
        );
    };
    
    ReactDOM.render(<App/>, document.getElementById('root'));
    

    useFeishuLogin

    飞书免登录

    const [code, setCode] = useFeishuLogin({
            id: 'testapp', // 应用标识 字符串即可
            url: 'https://xxx', // 飞书登录地址
            app_id: '', // 申请的飞书应用id
            redirect_uri: 'https://xxx' // 配置的重定向地址
        });
    
        useEffect(() => {
            if (code) {
                // 调用服务端接口去交换token 交换完成后最好在调用下setCode();
                // 登录成功或者失败后 code就不能用了 所以要调用下
                setCode();
            }
        }, [code]);

    Keywords

    Install

    npm i @gaopeng123/rc-login-module

    DownloadsWeekly Downloads

    80

    Version

    0.4.7

    License

    MIT

    Unpacked Size

    20.8 kB

    Total Files

    9

    Last publish

    Collaborators

    • gaopeng123