Pu Zhibing
2 天以前 6c3f781630bc0c559ceca1a69d4c9e7e33e5daf1
修改bug
4个文件已修改
37 ■■■■■ 已修改文件
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/AuthFilter.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-gateway/src/main/resources/bootstrap.yml 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-gateway/src/main/java/com/ruoyi/gateway/filter/AuthFilter.java
@@ -52,7 +52,8 @@
        if (StringUtils.matches(url, ignoreWhite.getWhites()))
        {
            //附近商户获取
            if(url.contains("getNearbyShop")||url.contains("pageRecommendGoods")||url.contains("pageActivityGoods")||url.contains("getGoodsInfo")||url.contains("getShopInfo")||url.contains("pageAppActivityGoods")){
            if(url.contains("getNearbyShop")||url.contains("pageRecommendGoods")||url.contains("pageActivityGoods")||url.contains("getGoodsInfo")
                    ||url.contains("getShopInfo")||url.contains("pageAppActivityGoods")||url.contains("/app/goods/listShoppingCart")||url.contains("/app/live/page")){
                String token = getToken(request);
                if(!StringUtils.isEmpty(token)){
                    Claims claims = JwtUtils.parseToken(token);
ruoyi-gateway/src/main/resources/bootstrap.yml
@@ -14,24 +14,24 @@
    nacos:
      discovery:
        # 服务注册地址
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        server-addr: 47.109.78.184:5000
#        server-addr: 127.0.0.1:8848
        #pro
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #test
#        namespace: e1a7e419-e8c7-4d7d-8a0a-c00ab6ccfccd
        #dev
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
#        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
      config:
        # 配置中心地址
#        server-addr: 47.109.78.184:5000
        server-addr: 127.0.0.1:8848
        server-addr: 47.109.78.184:5000
#        server-addr: 127.0.0.1:8848
        #pro
#        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        namespace: 9591ef9f-a49a-4900-be35-d77258bdd639
        #test
#        namespace: e1a7e419-e8c7-4d7d-8a0a-c00ab6ccfccd
        #dev
        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
#        namespace: 6857cbd9-6088-4fe8-bb58-2b516d99876f
        # 配置文件格式
        file-extension: yml
        # 共享配置
@@ -47,8 +47,8 @@
      datasource:
        ds1:
          nacos:
#            server-addr: 47.109.78.184:5000
            server-addr: 127.0.0.1:8848
            server-addr: 47.109.78.184:5000
#            server-addr: 127.0.0.1:8848
            dataId: sentinel-ruoyi-gateway
            groupId: DEFAULT_GROUP
            data-type: json
ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/miniapp/AppGoodsController.java
@@ -70,6 +70,7 @@
    @ApiOperation(value = "获取购物车列表")
    public R<List<AppShoppingCartVo>> listShoppingCart() {
        Long userId = SecurityUtils.getUserId();
        System.err.println("登录用户id:" + userId);
        if(null == userId){
            return R.ok(new ArrayList<>());
        }
ruoyi-modules/ruoyi-shop/src/main/java/com/ruoyi/shop/controller/console/ShopController.java
@@ -169,12 +169,19 @@
    }
    @PostMapping("/getShopByUserId")
    public R<ShopRelUserVo> getShopByUserId(@RequestBody Long userId)
    {
    public R<ShopRelUserVo> getShopByUserId(@RequestBody Long userId) {
        System.err.println("查询商户的用户id:" + userId);
        List<ShopRelUser> shopRelUser = shopRelUserService.getByUserId(userId);
        Optional.ofNullable(shopRelUser).orElseThrow(() -> new ServiceException("未查询到用户关联商户"));
        ShopRelUserVo shopRelUserVo = new ShopRelUserVo();
        ShopRelUser shopRelUser1 = shopRelUser.stream().filter(s -> s.getIsDefault() == 1).collect(Collectors.toList()).get(0);
        Optional<ShopRelUser> first = shopRelUser.stream().filter(s -> s.getIsDefault() == 1).findFirst();
        ShopRelUser shopRelUser1 = null;
        if(first.isPresent()){
            shopRelUser1 = first.get();
        }
        if(null == shopRelUser1){
            shopRelUser1 = shopRelUser.get(0);
        }
        shopRelUserVo.setShopId(shopRelUser1.getShopId());
        shopRelUserVo.setUserName(shopRelUser1.getUserName());
        Shop shop = shopService.getById(shopRelUser1.getShopId());