mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-08-11 21:57:56 +08:00
1.7.1
This commit is contained in:
@@ -24,8 +24,16 @@ http://openauth.yourdomain.com/oauth2/appToAppAuth?app_id=2019032617262200001&re
|
||||
| app_id | 开发者应用的AppId | String | 是 | 开发者应用的AppId | 2015101400446982 |
|
||||
| redirect_uri | 回调页面 | String | 是 | 参数需要UrlEncode | http%3A%2F%2Fexample.com |
|
||||
|
||||
|
||||
- 第二步:获取code
|
||||
|
||||
授权成功后,会跳转至开发者定义的回调页面(即redirect_uri参数对应的url),在回调页面请求中会带上当次授权的授权码code和开发者的app_id,示例如下:
|
||||
|
||||
http://www.xxx.com/oauth2callback?app_id=2015101400446982&code=ca34ea491e7146cc87d25fca24c4cD11
|
||||
|
||||
|
||||
- 第三步:使用code换取app_auth_token
|
||||
|
||||
接口名称:open.auth.token.app
|
||||
|
||||
开发者通过code可以换取app_auth_token、授权用户的userId。
|
||||
|
@@ -144,4 +144,7 @@ $(function () {
|
||||
})
|
||||
```
|
||||
|
||||
1.7.1开始支持接口名版本号放在url后面,规则:`http://host:port/{method}/{version}/`(最后的`/`不能少),如:`http://localhost:8081/story.demo.get/1.0/`
|
||||
等同于:`http://localhost:8081/api?method=story.demo.get&version=1.0`。
|
||||
|
||||
把接口名版本号放在url后面的好处是调用接口一目了然,在浏览器F12调试的时候特别有用,可以一眼看到调用了哪些接口,否则将会看到全部都是api请求,需要点开查看request header才能知道到底调用了哪个接口
|
||||
|
Reference in New Issue
Block a user