Browse Source

change merchant from body to header

guozhaoshun 6 years ago
parent
commit
85f4e647dc

+ 3 - 2
rankin-api-web/src/main/java/cn/rankin/apiweb/controller/LoginController.java

@@ -29,13 +29,14 @@ public class LoginController {
         String ip = HttpUtil.getClientIp(request);
         loginInfoDTO.setIp(ip);
         loginInfoDTO.setTerminal(request.getHeader("terminal"));
+        loginInfoDTO.setMerchant(request.getHeader("merchant"));
         return userService.login(loginInfoDTO);
     }
 
     @RequestMapping(method = RequestMethod.PUT)
-    public APIResult<UserInfoVo> refresh(@RequestBody DeviceLoginDTO deviceLoginDTO) {
+    public APIResult<UserInfoVo> refresh(HttpServletRequest request, @RequestBody DeviceLoginDTO deviceLoginDTO) {
         String deviceCode = deviceLoginDTO.getDeviceCode();
-        String merchant = deviceLoginDTO.getMerchant();
+        String merchant = request.getHeader("merchant");
         return userService.refresh(deviceCode, merchant, Boolean.TRUE);
     }