Pārlūkot izejas kodu

修复查询所属企业bug

zhangxin 5 dienas atpakaļ
vecāks
revīzija
e415580749

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

@@ -108,7 +108,12 @@ public class ChannelController {
     @GetMapping("/list")
     @ApiOperation(value = "查询全部")
     public R<List<Channel>> listByUserId() {
-        Long userId = SecurityUtils.getSysUser().getUserId();
+        Long userId = null;
+        try {
+            userId = SecurityUtils.getSysUser().getUserId();
+        } catch (Exception e) {
+            throw new GlobalException("获取当前登录用户失败");
+        }
         List<Channel> channels = null;
         if(userId == Constant.SUPER_ADMIN_ID){
             channels = channelService.list();