草庐IT

onSignIn

全部标签

javascript - 带有 Google Auth Signin 的 Vuejs 全局函数

我正在使用vuejs2,但在使用Google身份验证登录时遇到问题。我使用vue成功设置并获得了注销和用户配置文件功能:exportdefault{data(){return{user:null};},methods:{getUserProfile(){constprofile=gapi.auth2.currentUser.get().getBasicProfile();console.log(profile.getIdToken());},signOut(){constauth2=gapi.auth2.getAuthInstance();auth2.signOut().then(fu

javascript - 在 AngularJS 应用程序中使用 google 用户登录

我读了thistutorial为了将我的AngularJS应用程序与谷歌登录连接起来。我按如下方式添加了google按钮(只需复制粘贴教程):在头部我添加了元标记:然后添加按钮本身:起初我只是复制了onSignIn教程中的方法(这只是一个通用处理程序,所以我不会将其复制到问题中)并将其放入...中标签,它起作用了。我现在想把这个方法放在AngularController中。所以我创建了一个Controller如下:app.controller('GoogleCtrl',function(){functiononSignIn(googleUser){varprofile=googleUs

javascript - 防止google自动触发data-onsuccess ="onSignIn"

我做了googleconnect让用户使用他们的google帐户登录。我所做的是,创建一个按钮然后创建onSignIn()functiononSignIn(googleUser){//Usefuldataforyourclient-sidescripts:varprofile=googleUser.getBasicProfile();console.log("ID:"+profile.getId());//Don'tsendthisdirectlytoyourserver!console.log("Name:"+profile.getName());console.log("Image