Commit 778c485b authored by 唐峰's avatar 唐峰

登录无客户端类型,设置默认

parent d0211fed
package cn.quantgroup.xyqb.controller.api.v2; package cn.quantgroup.xyqb.controller.api.v2;
import cn.quantgroup.xyqb.controller.IBaseController;
import cn.quantgroup.xyqb.controller.req.v2.LoginReq; import cn.quantgroup.xyqb.controller.req.v2.LoginReq;
import cn.quantgroup.xyqb.model.ClientType;
import cn.quantgroup.xyqb.model.JsonResult; import cn.quantgroup.xyqb.model.JsonResult;
import cn.quantgroup.xyqb.model.LoginBean; import cn.quantgroup.xyqb.model.LoginBean;
import cn.quantgroup.xyqb.service.v2.LoginContext; import cn.quantgroup.xyqb.service.v2.LoginContext;
...@@ -11,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -11,7 +13,7 @@ import org.springframework.web.bind.annotation.RestController;
@RestController @RestController
@RequestMapping("/api/v2/oauth") @RequestMapping("/api/v2/oauth")
public class OauthApiV2Controller { public class OauthApiV2Controller implements IBaseController {
private final LoginContext loginContext; private final LoginContext loginContext;
public OauthApiV2Controller(LoginContext loginContext) { public OauthApiV2Controller(LoginContext loginContext) {
...@@ -26,6 +28,9 @@ public class OauthApiV2Controller { ...@@ -26,6 +28,9 @@ public class OauthApiV2Controller {
*/ */
@PostMapping("/login") @PostMapping("/login")
public JsonResult<LoginBean> login(@RequestBody LoginReq loginReq){ public JsonResult<LoginBean> login(@RequestBody LoginReq loginReq){
if (loginReq.getClientType() == null) {
loginReq.setClientType(ClientType.APP.ordinal());
}
return JsonResult.buildSuccessResultGeneric(loginContext.interLogin(loginReq)); return JsonResult.buildSuccessResultGeneric(loginContext.interLogin(loginReq));
} }
} }
...@@ -593,7 +593,7 @@ public class UserServiceImpl implements IUserService, IBaseController { ...@@ -593,7 +593,7 @@ public class UserServiceImpl implements IUserService, IBaseController {
JSONArray array = new JSONArray(); JSONArray array = new JSONArray();
array.add(json); array.add(json);
registeredNotifyBlackHoleRabbitTemplate.convertAndSend(exchange, routingKey, array.toString()); registeredNotifyBlackHoleRabbitTemplate.convertAndSend(exchange, routingKey, array.toString());
log.info("登录补签合同事件:userId:{},templateIds:{}",user.getId(),templateId); log.info("登录补签合同事件:userId:{},templateIds:{},loginFrom:{},tenantId:{}",user.getId(),templateId,loginFrom,tenantId);
stringRedisTemplate.opsForValue().set(redisKey, array.toJSONString()); stringRedisTemplate.opsForValue().set(redisKey, array.toJSONString());
stringRedisTemplate.expire(redisKey, 1L, TimeUnit.MINUTES); stringRedisTemplate.expire(redisKey, 1L, TimeUnit.MINUTES);
}); });
......
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