上一篇說了 facebook的實現,接下來說下google 的實現了,國際化的用的少.實際詳細的文檔也不多,這記錄下來!
demo 地址請狠狠的戳這里 http://download.lllomh.com/cliect/#/product/J417101756893390
一:開發者平台配置
進入開發者平台 https://console.developers.google.com/apis/credentials?project=matest-247702
在憑據中創建app憑據:
設置 重定向地址等相關內容
動態演示:
我們需要的 是那個客戶端 ID!
二:代碼
核心代碼:
記得 npm install vue-google-signin-button-directive && npm install jsonwebtoken
結果如下:
比如這里 我的 url 是http://localhost:5000,那么開發者平台里面也要配置這個重定向地址=>