parent
b1ebd770c2
commit
64f80a589c
@ -1,32 +1,32 @@ |
||||
* [首页](/?t=1563439736156) |
||||
* [首页](/?t=1563956863130) |
||||
* 开发文档 |
||||
* [快速体验](files/10010_快速体验.md?t=1563439736157) |
||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1563439736174) |
||||
* [新增接口](files/10020_新增接口.md?t=1563439736174) |
||||
* [业务参数校验](files/10030_业务参数校验.md?t=1563439736174) |
||||
* [错误处理](files/10040_错误处理.md?t=1563439736174) |
||||
* [编写文档](files/10041_编写文档.md?t=1563439736174) |
||||
* [接口交互详解](files/10050_接口交互详解.md?t=1563439736174) |
||||
* [easyopen支持](files/10070_easyopen支持.md?t=1563439736175) |
||||
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1563439736175) |
||||
* [ISV管理](files/10085_ISV管理.md?t=1563439736175) |
||||
* [自定义路由](files/10086_自定义路由.md?t=1563439736175) |
||||
* [路由授权](files/10090_路由授权.md?t=1563439736175) |
||||
* [接口限流](files/10092_接口限流.md?t=1563439736175) |
||||
* [监控日志](files/10093_监控日志.md?t=1563439736175) |
||||
* [SDK开发](files/10095_SDK开发.md?t=1563439736175) |
||||
* [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1563439736176) |
||||
* [应用授权](files/10097_应用授权.md?t=1563439736176) |
||||
* [更改数据节点名称](files/10099_更改数据节点名称.md?t=1563439736176) |
||||
* [对接前端](files/10100_对接前端.md?t=1563439736176) |
||||
* [自定义过滤器](files/10102_自定义过滤器.md?t=1563439736176) |
||||
* [文件上传](files/10104_文件上传.md?t=1563439736176) |
||||
* [nacos注册中心](files/10106_nacos注册中心.md?t=1563439736176) |
||||
* [扩展其它注册中心](files/10107_扩展其它注册中心.md?t=1563439736176) |
||||
* [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1563439736176) |
||||
* [快速体验](files/10010_快速体验.md?t=1563956863132) |
||||
* [项目接入到SOP](files/10011_项目接入到SOP.md?t=1563956863153) |
||||
* [新增接口](files/10020_新增接口.md?t=1563956863153) |
||||
* [业务参数校验](files/10030_业务参数校验.md?t=1563956863153) |
||||
* [错误处理](files/10040_错误处理.md?t=1563956863153) |
||||
* [编写文档](files/10041_编写文档.md?t=1563956863153) |
||||
* [接口交互详解](files/10050_接口交互详解.md?t=1563956863153) |
||||
* [easyopen支持](files/10070_easyopen支持.md?t=1563956863154) |
||||
* [使用签名校验工具](files/10080_使用签名校验工具.md?t=1563956863154) |
||||
* [ISV管理](files/10085_ISV管理.md?t=1563956863154) |
||||
* [自定义路由](files/10086_自定义路由.md?t=1563956863154) |
||||
* [路由授权](files/10090_路由授权.md?t=1563956863154) |
||||
* [接口限流](files/10092_接口限流.md?t=1563956863154) |
||||
* [监控日志](files/10093_监控日志.md?t=1563956863154) |
||||
* [SDK开发](files/10095_SDK开发.md?t=1563956863154) |
||||
* [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1563956863154) |
||||
* [应用授权](files/10097_应用授权.md?t=1563956863155) |
||||
* [更改数据节点名称](files/10099_更改数据节点名称.md?t=1563956863155) |
||||
* [传统web开发](files/10100_传统web开发.md?t=1563956863155) |
||||
* [自定义过滤器](files/10102_自定义过滤器.md?t=1563956863155) |
||||
* [文件上传](files/10104_文件上传.md?t=1563956863155) |
||||
* [nacos注册中心](files/10106_nacos注册中心.md?t=1563956863155) |
||||
* [扩展其它注册中心](files/10107_扩展其它注册中心.md?t=1563956863155) |
||||
* [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1563956863155) |
||||
* 原理分析 |
||||
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1563439736177) |
||||
* [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1563439736177) |
||||
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1563439736177) |
||||
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1563439736177) |
||||
* [常见问题](files/90100_常见问题.md?t=1563439736177) |
||||
* [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1563956863156) |
||||
* [原理分析之路由存储](files/90011_原理分析之路由存储.md?t=1563956863156) |
||||
* [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1563956863156) |
||||
* [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1563956863156) |
||||
* [常见问题](files/90100_常见问题.md?t=1563956863156) |
||||
|
@ -1,41 +1,40 @@ |
||||
# 对接前端 |
||||
# 传统web开发 |
||||
|
||||
开放平台一般对接服务端应用,开发者使用SDK来调用接口。 |
||||
理论上来说,只要是客户端程序,都可以调用网关接口。因此,同样可以对接前端应用(H5、小程序、App)。 |
||||
本篇介绍如何使用SOP进行传统web服务开发,即对接前端应用(H5、小程序、App)。 |
||||
|
||||
针对H5页面,配置方式如下: |
||||
|
||||
- 网关关闭签名校验。`ApiConfig.getInstance().setIgnoreValidate(true);` |
||||
|
||||
由于是网页调用接口,把秘钥放在前端意义不大,干脆直接关闭签名校验。 |
||||
|
||||
- 设置统一的数据节点 |
||||
- 网关ZuulConfig继承WebappZuulConfiguration类 |
||||
|
||||
```java |
||||
@Configuration |
||||
public class ZuulConfig extends AlipayZuulConfiguration { |
||||
public class ZuulConfig extends WebappZuulConfiguration { |
||||
|
||||
static { |
||||
... |
||||
ApiConfig.getInstance().setIgnoreValidate(true); |
||||
ApiConfig.getInstance().setDataNameBuilder(new CustomDataNameBuilder()); |
||||
... |
||||
new ManagerInitializer(); |
||||
} |
||||
|
||||
} |
||||
``` |
||||
|
||||
设置后,网关统一的返回结果如下: |
||||
设置完毕,网关不在进行签名验证,网关统一的返回结果如下: |
||||
|
||||
```json |
||||
{ |
||||
"result": { |
||||
... |
||||
}, |
||||
"sign": "xxxxx" |
||||
} |
||||
} |
||||
``` |
||||
|
||||
- 微服务OpenServiceConfig继承WebappServiceConfiguration类 |
||||
|
||||
```java |
||||
public class OpenServiceConfig extends WebappServiceConfiguration { |
||||
... |
||||
} |
||||
``` |
||||
|
||||
其它内容不变 |
||||
|
||||
- 封装请求工具【可选】 |
||||
|
||||
封装请求,方便调用,针对vue的封装如下: |
Loading…
Reference in new issue