Ver código fonte

首页相关接口全部放开校验,接口中获取不到用户信息则直接跳过

wangwl 3 meses atrás
pai
commit
f9140221e3

+ 8 - 4
leromro-admin/src/main/java/com/leromro/web/controller/system/SysLoginController.java

@@ -150,10 +150,14 @@ public class SysLoginController
     @ApiOperation("修改当前用户定位")
     @PostMapping("/setUserLocation")
     public AjaxResult setUserOrWorker(@RequestBody SysUser user){
-        Long userId = SecurityUtils.getUserId();
-        user.setUserId(userId);
-        userService.updateById(user);
-        return AjaxResult.success();
+        try {
+            Long userId = SecurityUtils.getUserId();
+            user.setUserId(userId);
+            userService.updateById(user);
+            return AjaxResult.success();
+        } catch (Exception e) {
+            return null;
+        }
     }
 
     /**

+ 6 - 1
leromro-core/src/main/java/com/leromro/core/controller/VolunteerInfoController.java

@@ -177,7 +177,12 @@ public class VolunteerInfoController extends BaseController {
     @ApiOperation("小程序志愿者首页获取自己的头像(用于排班管理)")
     @GetMapping("/volunteerPicture")
     public List<String> getVolunteerPicture() {
-        return volunteerInfoService.getVolunteerPicture(SecurityUtils.getUserId());
+        try {
+            Long userId = SecurityUtils.getUserId();
+            return volunteerInfoService.getVolunteerPicture(userId);
+        }catch (Exception e){
+            return null;
+        }
     }
 
     /**

+ 3 - 3
leromro-core/src/main/java/com/leromro/core/service/impl/MainOrderServiceImpl.java

@@ -110,9 +110,9 @@ public class MainOrderServiceImpl extends ServiceImpl<MainOrdersMapper, MainOrde
     @Override
     @Transactional(rollbackFor = Exception.class)
     public R<OrderPaymentVO> createOrders(OrderRequestDTO orderRequest) throws Exception {
-//        if (1==1) {
-//            return R.fail("当前地区志愿者批量认证中,暂时关闭预约功能,请谅解");
-//        }
+        if (1==1) {
+            return R.fail("当前地区志愿者批量认证中,暂时关闭预约功能,请谅解");
+        }
         //响应数据
         OrderPaymentVO vo = new OrderPaymentVO();
         //订单信息

+ 3 - 1
leromro-framework/src/main/java/com/leromro/framework/config/SecurityConfig.java

@@ -112,7 +112,9 @@ public class SecurityConfig
                 permitAllUrl.getUrls().forEach(url -> requests.antMatchers(url).permitAll());
                 // 对于登录login 注册register 验证码captchaImage 允许匿名访问
                 requests.antMatchers("/login","/loginWeb", "/register", "/captchaImage","/system/dict/**,","/websocket/**",
-                                "/core/users/orders/payNotify","/core/users/orders/refundNotify","/system/config/getHomeRollText","/system/config/serviceUrl/**","/core/searchHistory/info/businessTireNameHistory","/core/volunteer/info/searchBusinessTypeList").permitAll()
+                                "/core/users/orders/payNotify","/core/users/orders/refundNotify","/system/config/getHomeRollText",
+                                "/system/config/serviceUrl/**","/core/searchHistory/info/businessTireNameHistory","/core/volunteer/info/searchBusinessTypeList",
+                                "/core/volunteer/info/volunteerPicture","/setUserLocation").permitAll()
                     //微信小程序需要提供部分预览功能
                     .antMatchers("/core/volunteer/info/list","/core/volunteer/info/getDetails",
                                 "/web/core/slideshow/**","/core/business/management/**",