5

Google plus 登录在桌面浏览器上运行良好,但在移动浏览器上却不行。网站
链接

var client_id   = gmail_client_id;
var scope       = gmail_scope;
var apiKey      = google_api_key;


function handleClientLoad() {
    gapi.client.setApiKey(apiKey);
    window.setTimeout(checkAuth,1);
}

function checkAuth() {
    gapi.auth.authorize({client_id: client_id, scope: scope, immediate: true}, handleAuthResult);
}

function handleAuthResult(authResult) {

    if (authResult && !authResult.error) {
        access_token = authResult.access_token;

        makeApiCall();
    } else {

        handleAuthClick();
    }
}

function handleAuthClick(event) {
    gapi.auth.authorize({client_id: client_id, scope: scope, immediate: false}, handleAuthResult);
    return false;
}


function makeApiCall() {
    gapi.client.load('oauth2', 'v2', function() {
        var request = gapi.client.oauth2.userinfo.get();
        request.execute(function(resp) {
            checkGoogleUserExist(resp);
        });
    });
}

请提出可能的问题。

4

0 回答 0