fxlwpy2000 2018-03-30 03:28 采纳率: 0%
浏览 3997
已结题

jitsi meet源码中,在登录界面提交登录信息的代码处理

登录jitsimeet,在登录界面填写用户名和密码后,压下OK键,进入jitsimeet。
如下代码为压下OK按键的代码:

    _onLogin() {
        const { _conference: conference, dispatch } = this.props;
        const { password, username } = this.state;
        const jid = toJid(username, this.props._configHosts);
        let r;

        // If there's a conference it means that the connection has succeeded,
        // but authentication is required in order to join the room.
        if (conference) {
            r = dispatch(authenticateAndUpgradeRole(jid, password, conference));
        } else {
            r = dispatch(connect(jid, password));
        }

        return r;
    }
    
<pre>
    export function authenticateAndUpgradeRole(
    id: string,
    password: string,
    conference: Object) {
return (dispatch: Dispatch, getState: Function) => {
    const { password: roomPassword }
        = getState()['features/base/conference'];
    const process
        = conference.authenticateAndUpgradeRole({
            id,
            password,
            roomPassword,

            onLoginSuccessful() {
                // When the login succeeds, the process has completed half
                // of its job (i.e. 0.5).
                return dispatch(_upgradeRoleFinished(process, 0.5));
            }
        });

    dispatch(_upgradeRoleStarted(process));
    process.then(
        /* onFulfilled */ () => dispatch(_upgradeRoleFinished(process, 1)),
        /* onRejected */ error => {
            // The lack of an error signals a cancellation.
            if (error.authenticationError || error.connectionError) {
                logger.error('authenticateAndUpgradeRole failed', error);
            }

            dispatch(_upgradeRoleFinished(process, error));
        });

    return process;
};

}


在authenticateAndUpgradeRole函数中,如下代码段

        const process
            = conference.authenticateAndUpgradeRole({
                id,
                password,
                roomPassword,

                onLoginSuccessful() {
                    // When the login succeeds, the process has completed half
                    // of its job (i.e. 0.5).
                    return dispatch(_upgradeRoleFinished(process, 0.5));
                }
            });
    

其中的conference.authenticateAndUpgradeRole应该实现的是用户名和密码的验证功能,但是我在源码工程中没有找到该接口的定义,请大神指教上述代码段的功能,以及如何能够找到提交登录信息后,是如何验证用户名和密码的?

  • 写回答

1条回答 默认 最新

  • dabocaiqq 2018-04-11 14:34
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 如何实验stm32主通道和互补通道独立输出
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题
  • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题