Commit af9f0141 authored by 唐峰's avatar 唐峰

兼容登录时clientType为空的情况

parent ad05b35b
...@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -11,6 +11,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Objects;
@RestController @RestController
@RequestMapping("/api/v2/oauth") @RequestMapping("/api/v2/oauth")
public class OauthApiV2Controller implements IBaseController { public class OauthApiV2Controller implements IBaseController {
...@@ -29,7 +31,9 @@ public class OauthApiV2Controller implements IBaseController { ...@@ -29,7 +31,9 @@ public class OauthApiV2Controller implements IBaseController {
@PostMapping("/login") @PostMapping("/login")
public JsonResult<LoginBean> login(@RequestBody LoginReq loginReq){ public JsonResult<LoginBean> login(@RequestBody LoginReq loginReq){
if (loginReq.getClientType() == null) { if (loginReq.getClientType() == null) {
loginReq.setClientType(ClientType.APP.ordinal()); Long registeredFrom = getRegisteredFrom();
Integer clientType = Objects.equals(registeredFrom,217L) || Objects.equals(registeredFrom,214L) ? ClientType.APP.ordinal():ClientType.H5.ordinal();
loginReq.setClientType(clientType);
} }
return JsonResult.buildSuccessResultGeneric(loginContext.interLogin(loginReq)); return JsonResult.buildSuccessResultGeneric(loginContext.interLogin(loginReq));
} }
......
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