浏览代码

修改导出获取token问题

zhangxin 2 周之前
父节点
当前提交
04dbefe337

+ 6 - 1
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderController.java

@@ -253,7 +253,12 @@ public class OrderController {
            throw new GlobalException("请求参数-所属企业不允许为空");
         }
         if (orderParam.getChannelIdList().contains(0L)){
-            Long userId = SecurityUtils.getSysUser().getUserId();
+            Long userId = null;
+            try {
+                userId = SecurityUtils.getSysUser().getUserId();
+            } catch (Exception e) {
+                throw new GlobalException("获取当前登录用户失败");
+            }
             List<Long> channelIdList =  sysUserService.findByUserIdListId(userId);
             orderParam.setChannelIdList(channelIdList);
         }

+ 6 - 1
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/OrderRefundController.java

@@ -158,7 +158,12 @@ public class OrderRefundController {
             throw new GlobalException("请求参数-所属企业不允许为空");
         }
         if (orderRefund.getChannelIdList().contains(0L)){
-            Long userId = SecurityUtils.getSysUser().getUserId();
+            Long userId = null;
+            try {
+                userId = SecurityUtils.getSysUser().getUserId();
+            } catch (Exception e) {
+                throw new GlobalException("获取当前登录用户失败");
+            }
             List<Long> channelIdList =  sysUserService.findByUserIdListId(userId);
             orderRefund.setChannelIdList(channelIdList);
         }

+ 6 - 1
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/PointsRechargeController.java

@@ -163,7 +163,12 @@ public class PointsRechargeController {
             throw new GlobalException("请求参数-所属企业不允许为空");
         }
         if (pointsRecharge.getChannelIdList().contains(0L)){
-            Long userId = SecurityUtils.getSysUser().getUserId();
+            Long userId = null;
+            try {
+                userId = SecurityUtils.getSysUser().getUserId();
+            } catch (Exception e) {
+                throw new GlobalException("获取当前登录用户失败");
+            }
             List<Long> channelIdList =  sysUserService.findByUserIdListId(userId);
             pointsRecharge.setChannelIdList(channelIdList);
         }

+ 6 - 1
yami-shop-platform/src/main/java/com/yami/shop/platform/controller/UserEnterpriseController.java

@@ -129,7 +129,12 @@ public class UserEnterpriseController {
             throw new GlobalException("请求参数-所属企业不允许为空");
         }
         if (po.getChannelIdList().contains(0L)){
-            Long userId = SecurityUtils.getSysUser().getUserId();
+            Long userId = null;
+            try {
+                userId = SecurityUtils.getSysUser().getUserId();
+            } catch (Exception e) {
+                throw new GlobalException("获取当前登录用户失败");
+            }
             List<Long> channelIdList =  sysUserService.findByUserIdListId(userId);
             po.setChannelIdList(channelIdList);
         }

+ 0 - 1
yami-shop-security/yami-shop-security-platform/src/main/java/com/yami/shop/security/platform/config/ResourceServerConfiguration.java

@@ -64,7 +64,6 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
                     "/admin/enterprise/downloadXlsx",
                     "/admin/enterprise/downloadExcel",
                     "/admin/enterprise/downloadErrorExcel",
-                    "/admin/enterprise/export",
                     "/captcha.jpg").permitAll()
             .and()
             .authorizeRequests()