Commit 4e79ae21 by giaogiao

增加接口:根据客户方生成签名字符串 验证通过则下发token

parent 3e37cfef
...@@ -155,7 +155,7 @@ public class Swagger2Config { ...@@ -155,7 +155,7 @@ public class Swagger2Config {
@Bean @Bean
public Docket restAppApi() { public Docket restAppApi() {
// 获取需要扫描的包 // 获取需要扫描的包
String[] basePackages = {"com.sien.common.controller"}; String[] basePackages = {"com.wecloud.im.controller"};
ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2) ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()) .apiInfo(apiInfo())
.groupName("app") .groupName("app")
...@@ -174,53 +174,53 @@ public class Swagger2Config { ...@@ -174,53 +174,53 @@ public class Swagger2Config {
.globalOperationParameters(getParameters()); .globalOperationParameters(getParameters());
return docket; return docket;
} }
//
@Bean // @Bean
public Docket restSysApi() { // public Docket restSysApi() {
// 获取需要扫描的包 // // 获取需要扫描的包
String[] basePackages = {"com.jumeirah.api.system.controlle"}; // String[] basePackages = {"com.jumeirah.api.system.controlle"};
ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2) // ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()) // .apiInfo(apiInfo())
.groupName("system") // .groupName("system")
//
.select(); // .select();
// 如果扫描的包为空,则默认扫描类上有@Api注解的类 // // 如果扫描的包为空,则默认扫描类上有@Api注解的类
if (ArrayUtils.isEmpty(basePackages)) { // if (ArrayUtils.isEmpty(basePackages)) {
apiSelectorBuilder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class)); // apiSelectorBuilder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class));
} else { // } else {
// 扫描指定的包 // // 扫描指定的包
apiSelectorBuilder.apis(basePackage(basePackages)); // apiSelectorBuilder.apis(basePackage(basePackages));
} // }
Docket docket = apiSelectorBuilder.paths(PathSelectors.any()) // Docket docket = apiSelectorBuilder.paths(PathSelectors.any())
.build() // .build()
.enable(swaggerProperties.isEnable()) // .enable(swaggerProperties.isEnable())
.ignoredParameterTypes(ignoredParameterTypes) // .ignoredParameterTypes(ignoredParameterTypes)
.globalOperationParameters(getParameters()); // .globalOperationParameters(getParameters());
return docket; // return docket;
} // }
//
@Bean // @Bean
public Docket restMerchantApi() { // public Docket restMerchantApi() {
// 获取需要扫描的包 // // 获取需要扫描的包
String[] basePackages = {"com.jumeirah.api.merchant.controller"}; // String[] basePackages = {"com.jumeirah.api.merchant.controller"};
ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2) // ApiSelectorBuilder apiSelectorBuilder = new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo()) // .apiInfo(apiInfo())
.groupName("merchant") // .groupName("merchant")
.select(); // .select();
// 如果扫描的包为空,则默认扫描类上有@Api注解的类 // // 如果扫描的包为空,则默认扫描类上有@Api注解的类
if (ArrayUtils.isEmpty(basePackages)) { // if (ArrayUtils.isEmpty(basePackages)) {
apiSelectorBuilder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class)); // apiSelectorBuilder.apis(RequestHandlerSelectors.withClassAnnotation(Api.class));
} else { // } else {
// 扫描指定的包 // // 扫描指定的包
apiSelectorBuilder.apis(basePackage(basePackages)); // apiSelectorBuilder.apis(basePackage(basePackages));
} // }
Docket docket = apiSelectorBuilder.paths(PathSelectors.any()) // Docket docket = apiSelectorBuilder.paths(PathSelectors.any())
.build() // .build()
.enable(swaggerProperties.isEnable()) // .enable(swaggerProperties.isEnable())
.ignoredParameterTypes(ignoredParameterTypes) // .ignoredParameterTypes(ignoredParameterTypes)
.globalOperationParameters(getParameters()); // .globalOperationParameters(getParameters());
return docket; // return docket;
} // }
/** /**
......
...@@ -51,6 +51,11 @@ public class ImClientLoginServiceImpl implements ImClientLoginService { ...@@ -51,6 +51,11 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
new QueryWrapper<ImApplication>().lambda().eq(ImApplication::getAppKey, imTokenVerify.getAppKey()) new QueryWrapper<ImApplication>().lambda().eq(ImApplication::getAppKey, imTokenVerify.getAppKey())
); );
if (imApplication == null) {
log.debug("imApplication == null");
return ApiResult.result(ApiCode.FAIL, null);
}
// 生成以数据库为准的签名 // 生成以数据库为准的签名
String mySign = new MD5().digestHex(imTokenVerify.getTimestemp() + imTokenVerify.getClientId() + imApplication.getAppKey() + imApplication.getAppSecret()); String mySign = new MD5().digestHex(imTokenVerify.getTimestemp() + imTokenVerify.getClientId() + imApplication.getAppKey() + imApplication.getAppSecret());
...@@ -86,6 +91,7 @@ public class ImClientLoginServiceImpl implements ImClientLoginService { ...@@ -86,6 +91,7 @@ public class ImClientLoginServiceImpl implements ImClientLoginService {
redisTemplate.opsForValue().set("client:" + imApplication.getAppKey() + ":" + imTokenVerify.getClientId(), generateToken); redisTemplate.opsForValue().set("client:" + imApplication.getAppKey() + ":" + imTokenVerify.getClientId(), generateToken);
TokenVo tokenVo = new TokenVo(); TokenVo tokenVo = new TokenVo();
tokenVo.setToken(generateToken);
return ApiResult.ok(tokenVo); return ApiResult.ok(tokenVo);
} }
......
...@@ -12,7 +12,6 @@ spring-boot-plus: ...@@ -12,7 +12,6 @@ spring-boot-plus:
request-log-format: false request-log-format: false
response-log-format: false response-log-format: false
domain: https://767827238379.ngrok.io
spring: spring:
datasource: datasource:
......
...@@ -13,7 +13,6 @@ spring-boot-plus: ...@@ -13,7 +13,6 @@ spring-boot-plus:
log-print-type: NONE log-print-type: NONE
request-log-format: false request-log-format: false
response-log-format: false response-log-format: false
domain: https://sienapi.da300.com
server: server:
port: 8181 port: 8181
......
...@@ -12,7 +12,6 @@ spring-boot-plus: ...@@ -12,7 +12,6 @@ spring-boot-plus:
log-print-type: LINE log-print-type: LINE
request-log-format: false request-log-format: false
response-log-format: false response-log-format: false
domain: https://sienapi.da300.com
spring: spring:
......
...@@ -184,12 +184,9 @@ spring-boot-plus: ...@@ -184,12 +184,9 @@ spring-boot-plus:
# 权限配置 # 权限配置
anon: anon:
# 排除登录 注册 登出 # 排除登录 注册 登出
- /user/registerOrLogin,/user/login
- /sms/registerOrLoginCode
- /wechatUser/check
- /app/noRole - /app/noRole
# 客户端token获取
- /wxapi/checkToken - /token/verify
# 排除静态资源 # 排除静态资源
- /static/**,/templates/** - /static/**,/templates/**
# 排除Swagger # 排除Swagger
...@@ -198,10 +195,6 @@ spring-boot-plus: ...@@ -198,10 +195,6 @@ spring-boot-plus:
# - /actuator/** # - /actuator/**
- # 排除首页 - # 排除首页
- /,/index.html - /,/index.html
# 微信支付回调
- /pay/notify/donationOrder
- /pay/notify/vipOrder
# 多行字符串权限配置 # 多行字符串权限配置
filter-chain-definitions: | filter-chain-definitions: |
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment