google plus登录在javascript中是如何工作的?

google plus登录在javascript中是如何工作的?,javascript,oauth-2.0,google-openid,google-login,Javascript,Oauth 2.0,Google Openid,Google Login,我已经在我的网站上使用javascript实现了google plus登录: <div id="googlenew"> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = t

我已经在我的网站上使用javascript实现了google plus登录:

<div id="googlenew">
    <script type="text/javascript">
        (function() {
            var po = document.createElement('script');
            po.type = 'text/javascript';
            po.async = true;
            po.src = 'https://apis.google.com/js/client.js?onload=onLoadCallback';
            var s = document.getElementsByTagName('script')[0];
            s.parentNode.insertBefore(po, s);
        })();
        function logout()
        {
            alert("in logout");
            gapi.auth.signOut();
            location.reload();
        }
        function login()
        {
            alert("in login");
            var myParams = {
                'clientid': '11818350844-r7c61fc96gjtor64oa75ccaun1k52gni.apps.googleusercontent.com',
                'cookiepolicy': 'single_host_origin',
                'callback': 'loginCallback',
                'approvalprompt': 'force',
                'scope': 'https://www.googleapis.com/auth/plus.login https://www.googleapis.com/auth/plus.profile.emails.read'
            };
            gapi.auth.signIn(myParams);
        }
        function loginCallback(result)
        {
            alert("in login call back");
            if (result['status']['signed_in'])
            {
                alert("Is signed in:"+result['status']['signed_in']);
                var request = gapi.client.plus.people.get(
                        {
                            'userId': 'me'
                        });
                request.execute(function(resp)
                {
                    var email = '';
                    if (resp['emails'])
                    {
                        for (i = 0; i < resp['emails'].length; i++)
                        {
                            if (resp['emails'][i]['type'] == 'account')
                            {
                                email = resp['emails'][i]['value'];
                            }
                        }
                    }

                    var str = "Name:" + resp['displayName'] + "<br>";
                    str += "Image:" + resp['image']['url'] + "<br>";
                    str += "<img src='" + resp['image']['url'] + "' /><br>";

                    str += "URL:" + resp['url'] + "<br>";
                    str += "Email:" + email + "<br>";
                    document.getElementById("profile").innerHTML = str;
                });

            }

        }
        function onLoadCallback()
        {
            alert("in onLoadCallback");
            gapi.client.setApiKey('11818350844-r7c61fc96gjtor64oa75ccaun1k52gni.apps.googleusercontent.com');
            gapi.client.load('plus', 'v1', function() {
            });
        }
    </script>    
</div>
<input type="button"  value="Login" onclick="login()" />
<input type="button"  value="Logout" onclick="logout()" />
<div id="profile">User Information</div>
提醒我:

Is signed in true
登录后。然后发生了什么我不知道,什么都没有发生

gapi.client.plus.get({'userid':'me'})
没有任何回应。。有人能尽快帮我吗? 多谢各位

我正在浏览器控制台中设置此错误:

XMLHttpRequest cannot load https://gateway.zscaler.net/auD?origurl=https%3A%2F%2Fcontent%2egoogleapis%…dr7c61fc96gjtor64oa75ccaun1k52gni%2eapps%2egoogleusercontent%2ecom&wexps=1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://content.googleapis.com' is therefore not allowed access. 
XMLHttpRequest cannot load https://gateway.zscaler.net/auD?origurl=https%3A%2F%2Fcontent%2egoogleapis%…dr7c61fc96gjtor64oa75ccaun1k52gni%2eapps%2egoogleusercontent%2ecom&wexps=1. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://content.googleapis.com' is therefore not allowed access.