Oauth 2.0 对谷歌的行动';登录';帮手

Oauth 2.0 对谷歌的行动';登录';帮手,oauth-2.0,actions-on-google,google-authentication,Oauth 2.0,Actions On Google,Google Authentication,我在谷歌应用程序上的操作中使用了以下代码: app.intent('Get Sign In', async (conv, params, signin) => { if (signin.status !== 'OK') { return conv.close(`Let's try again next time.`); } const color = conv.data[Fields.COLOR]; const {email} = conv.user; if (

我在谷歌应用程序上的操作中使用了以下代码:

app.intent('Get Sign In', async (conv, params, signin) => {
  if (signin.status !== 'OK') {
    return conv.close(`Let's try again next time.`);
  }
  const color = conv.data[Fields.COLOR];
  const {email} = conv.user;
  if (!conv.data.uid && email) {
    try {
      conv.data.uid = (await auth.getUserByEmail(email)).uid;
    } catch (e) {
      if (e.code !== 'auth/user-not-found') {
        throw e;
      }
      // If the user is not found, create a new Firebase auth user
      // using the email obtained from the Google Assistant
      conv.data.uid = (await auth.createUser({email})).uid;
    }
  }
  if (conv.data.uid) {
    conv.user.ref = db.collection('users').doc(conv.data.uid);
  }
  conv.close(`I saved ${color} as your favorite color for next time.`);
});

我一直在看文档,但是找不到关于函数的'params'参数的任何解释?如何向其传递值?

如果使用dialogflow,则可以使用params对象。例如,如果在Dialogflow中使用实体,则可以通过意图处理程序中的params对象检索它们

如果使用Dialogflow,则可以通过params变量访问参数值


可以找到有关参数对象本身的更多信息。

谢谢!我应该重新表述我的问题:我从代码中触发一个“new sign()”。然后OAuth过程开始。之后,将触发“获取登录”意图。是否可以通过代码将参数动态添加到“获取登录”中?据我所知,这是不可能的,从新SignIn()事件的响应中获得的唯一信息是SignIn对象,您可以在其中检查SignIn的状态并对其采取行动。我只看到params对象从用户输入触发的正常意图中获取params。不是在登录事件中,如“获取登录”。我在signInHelper文档中也没有看到任何关于添加到params对象的内容。