‘linchangsheng’ 2 viikkoa sitten
vanhempi
commit
e378e835f8

+ 3 - 3
src/main/java/com/gree/mall/miniapp/controller/user/UserController.java

@@ -189,11 +189,11 @@ public class UserController {
     @PostMapping("/userWebsit")
     @ApiOperation(value = "获得当前用户的门店")
     public ResponseHelper<AdminWebsit> userWebsit(
-            @ApiParam(required = true, value = "用户id") @RequestParam(required = true) String userId,
             @ApiParam(required = true, value = "经度") @RequestParam(required = true) String lng,
-            @ApiParam(required = true, value = "纬度") @RequestParam(required = true) String lat
+            @ApiParam(required = true, value = "纬度") @RequestParam(required = true) String lat,
+            HttpServletRequest request
     ) throws RemoteServiceException {
-        AdminWebsit adminWebsit = userLogic.userWebsit(userId,lng,lat);
+        AdminWebsit adminWebsit = userLogic.userWebsit(lng,lat,request);
         return ResponseHelper.success(adminWebsit);
     }
 

+ 4 - 3
src/main/java/com/gree/mall/miniapp/logic/user/UserLogic.java

@@ -561,14 +561,15 @@ public class UserLogic {
     }
 
 
-    public AdminWebsit userWebsit(String userId, String lng, String lat) {
-        User user = userService.getById(userId);
+    public AdminWebsit userWebsit(String lng, String lat,HttpServletRequest request) {
+        CurrentCompanyWechat currentCompanyWechat = commonLogic.getCurrentCompanyWechat(request);
+        User user = userService.getById(currentCompanyWechat.getUserId());
         if (!StringUtil.isEmpty(user.getServiceId())) {
             AdminWebsit adminWebsit = adminWebsitService.getById(user.getWebsitId());
             return adminWebsit;
         }
 
-        AdminWebsit adminWebsit = userInfoMapper.userWebsit(userId, lng, lat);
+        AdminWebsit adminWebsit = userInfoMapper.userWebsit(user.getUserId(), lng, lat);
 
         if (adminWebsit == null)
             return null;