Code Monkey home page Code Monkey logo

newbee-mall-api's Issues

vue页面cart.vue修正

很抱歉发在这里,因为你的vue那里不允许提交issues.

第114 这段修正:

async onChange(value, detail) {
if (this.list.filter(item => item.CartItemId == detail.name)[0].GoodsCount == value) return
Toast.loading({ message: '修改中...', forbidClick: true });
const params = {
cartItemId: detail.name,
goodsCount: value
}
try {
const { data } = await modifyCart(params)
this.list.forEach(item => {
if (item.CartItemId == detail.name) {
item.GoodsCount = value
}
})
} catch (e) {
console.log( e.message );
}
Toast.clear();
},

加了catch, 要不然浏览器中红叉叉难看

pom.xml error

缺失验证依赖包的引入 , 导致编译不通过

<dependency>
            <groupId>javax.validation</groupId>
            <artifactId>validation-api</artifactId>
        </dependency>

账号管理保存功能将用户密码修改为空字符串,导致用户无法登录

开源作者:

​ 您好,首先非常感谢您能将新蜂商城系统开源,该开源项目使我受益匪浅。

​ 之后,我在学习该项目的过程中发现了一个小bug,bug情况如下:

  1. 我在系统中注册了一个user账号,密码为123456

image-20200727171329175

2.当我使用账号管理修改相关信息时,因不想修改密码的缘故没有填写“修改密码”选项
image-20200727171447503
3.进行保存
image-20200727171458532
4.此时的后端调试结果如下,前端将空字符串传至/user/info接口,使得将空字符串(d41d8cd98f00b204e9800998ecf8427e)作为密码写入数据库,最终导致用户无法登录的情况
image-20200727171524993
image-20200727171724023
我按照我自己的想法对项目代码做了修改,即在NewBeeMallUserServiceImpl中的updateUserInfo方法中增加了如下代码:

    //若密码为空字符,则表明用户不打算修改密码,使用原密码保存
    if (!MD5Util.MD5Encode("", "UTF-8").equals(mallUser.getPasswordMd5())){
        user.setPasswordMd5(mallUser.getPasswordMd5());
    }

image-20200727172205558
最终效果如下:

使得用户若未填写“修改密码”选项时,利用原密码进行保存,不修改原密码。
image-20200727172448436
image-20200727172505589


以上就是关于这个小bug情况和解决这个小bug的过程,若对项目的理解不够透彻还请作者见谅。我已经开启了一个pull request。目前,我是一名大二学生,若您能接受此处pull request,那么它将可以出现在我未来春秋招的简历之中。我会非常感激您!

最后,再次感谢您能开源此项目。

HashMap初始入参

ltd.newbee.mall.api.NewBeeMallGoodsAPI#search
--Map params = new HashMap(4);

最大params是6,初始化大小设置为8是不是好点?
设置为4,*0.75的话,设置到第四个就会开始走扩容了
设置为8,*0.75的话,设置到第六个也不会扩容

更新库存返回结果与预期不一致

开源作者,您好。
当前项目中NewBeeMallGoodsMapper#updateStockNum方法在更新库存时,返回结果与预期不一致。
当更新多个商品库存时若其中一个商品库存少于购买数时,也会返回1 则无法根据返回值判断商品库存是否全部更新成功,可能会出现超卖问题。
测试代码已上传至我的fork仓库中


项目截图如下:
10005库存为0
更新库存
返回值依旧为1
并发可能存在超卖问题

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.