集成Google登录需要更改什么?

时间:2019-03-07 09:12:26

标签: jquery google-signin deprecated

以下是我们用于登录Google的脚本。由于使用者版本即将关闭,因此需要在以下代码中进行哪些更改?

$.getScript("//apis.google.com/js/client:platform.js?onload=loadClient", () => {
  gapi.load("auth2", () => {
    gapi.client.load("plus", "v1").then(() => {
      gapi.client.init({
        apiKey: $("meta[property='google:api_key']").attr("content"),
        clientId: $("meta[property='google:client_id']").attr("content"),
        // eslint-disable-next-line max-len
        scope: "https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile",
      }).then(() => {
        GoogleAuth = gapi.auth2.getAuthInstance();
      }, response => {
        console.warn(response);
      });
    });
  });
});

0 个答案:

没有答案
相关问题