以下是我们用于登录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);
});
});
});
});