我在 JSP 应用程序中使用 Google Oauth2 Javascript。
<script src="https://apis.google.com/js/client.js"></script>
function googleOAuth(idx) {
alert ("Please ensure that popup windows are enabled in your browser. You will authenticate directly with Google in another window.");
var config = {
'client_id': '<%=googleClientId%>',
'scope': 'https://mail.google.com/ https://www.googleapis.com/auth/userinfo.email',
'response_type': 'token',
'immediate': false
};
gapi.auth.authorize(config, function() {
var token = gapi.auth.getToken();
/// ...use token
});
}
我的应用程序运行良好,直到昨天,今天它未能授权,Chrome 控制台说:
Uncaught TypeError: undefined is not a function at line cb=gapi.loaded_0:223 处理函数尚未执行。第 223 行有以下内容:
var f=c.popup,g=c.after_redirect;f&&"keep_open"!=g&&(0,_.Uu)(window,f)
而且我看不到 g&&(0,_.Uu)(window,f) 如何成为有效的JS。
其他人也看到这个吗?