第三方插件,支持使用Google Login作为YApi的第三方登录
在生成的配置文件中,添加如下配置:
"plugins": [
{
"name": "google",
"options": {
"buttonText": "Sign In with Google",
"clientId": "xxx",
"secret": "xxx",
"redirectUri": "http://your-yapi-server/api/user/login_by_token"
}
}
]
这里面的配置项含义如下:
-
buttonText
登录按钮显示文字 -
clientId
google credentials clientId -
secret
google credentials secret -
redirectUri
回调地址
在 Google Cloud中增加redirectUri
到Authorized redirect URIs
启动并测试服务
npm install
node server/app.js