【问题标题】:how to save mutiple values in raiseevent() python function如何在raiseevent()python函数中保存多个值
【发布时间】:2019-05-26 07:18:05
【问题描述】:

在 Pepper Robo 中,我想在 python 的 raiseEvent() 方法中将用户名和密码作为值传递,以验证用户登录详细信息。

我在工作项目中添加了以下功能

sesson.raiseEvent("eventname", username, password)

    function login()
    {
             alert('reached login details');
             var username = document.getElementById('txtusername').value;
             var password = document.getElementById('txtpassword').value;
             //alert(username);
             //alert(password);
             loginDetails(username,password);

    }


    function loginDetails(username,password){

                session.raiseEvent("loginreq", username,password);
                //window.location = 'paybympay.html?Language='+ LANGUAGE;
    }

.raiseEvent() 必须接受多个值,例如用户名和密码

tested in pepper robot did not accept the multiple values. how to achieve this.

【问题讨论】:

    标签: python pepper


    【解决方案1】:

    我假设您显示的代码是 Pepper 平板电脑上的 javascript。

    1) 你正在做的事情看起来很不安全。我强烈建议不要将任何原始用户密码作为 ALMemory 中的值传递,尤其是似乎是支付系统。

    2) 更好的方法是直接调用您自己的服务,例如从 javascript 中,您可以调用 MyServiceOnPepper.handleLogin(username, password),例如,请参阅 the service-tabletpage example here 了解这样做的方法。

    但我认为这对于用户密码来说不够安全,并且会添加加密(例如,使用 RSA,让您的服务发布公钥,并让 javascript 使用它来加密密码)。

    3) (技术上也可以将列表作为 ALMemory 事件传递,但使用专用服务更简洁且更安全)

    【讨论】:

      猜你喜欢
      • 2016-06-29
      • 2020-11-17
      • 2013-10-10
      • 2022-01-02
      • 1970-01-01
      • 1970-01-01
      • 2014-01-23
      • 2020-03-16
      • 1970-01-01
      相关资源
      最近更新 更多