免费分享一套SpringBoot+Vue在线商城(电子商城)系统【论文+源码+SQL脚本】,帅呆了~~

大家好,我是java1234_小锋老师,看到一个不错的SpringBoot+Vue在线商城(电子商城)系统,分享下哈。

项目视频演示

【免费】SpringBoot+Vue在线商城(电子商城)系统 Java毕业设计_哔哩哔哩_bilibili

项目介绍

随着互联网技术的发展和普及,电子商务在全球范围内得到了迅猛的发展,已经成为了一种重要的商业模式和生活方式。电子商城是电子商务的重要组成部分,是一个基于互联网的商业模式和交易平台,通过网络进行产品和服务的销售。电子商城已成为了线上交易和消费的主要方式,人们可以方便快捷地买到自己想要的商品和服务,并在家中享受线上购物的便利性和舒适性。

基于这个背景,我们决定开发一个功能强大、易于使用、可靠性高的商城系统,以满足用户在线购物的需求。这个商城系统将支持多种商品和服务的销售、多种支付方式和多种物流配送方式,提供优惠券和积分等扩展功能,为用户提供舒适的购物体验和服务。同时,我们还将采用最新的技术和开发模式,在保证系统稳定运行的同时,不断推出新的功能和特性,以满足用户不断增长的需求和期望。

系统展示

部分代码

package com.rabbiter.em.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rabbiter.em.annotation.Authority;
import com.rabbiter.em.constants.Constants;
import com.rabbiter.em.common.Result;
import com.rabbiter.em.entity.AuthorityType;
import com.rabbiter.em.entity.LoginForm;
import com.rabbiter.em.entity.User;
import com.rabbiter.em.entity.dto.UserDTO;
import com.rabbiter.em.service.UserService;
import com.rabbiter.em.utils.TokenUtils;
import com.sun.xml.internal.fastinfoset.stax.events.Util;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/*
这个注解表示该控制器下所有接口都可以通过跨域访问,注解内可以指定某一域名
也可以配置config类
 */
@CrossOrigin
@RestController
public class UserController {
    @Autowired
    private UserService userService;


    @PostMapping("/login")
    public Result login(@RequestBody LoginForm loginForm) {
        UserDTO dto = userService.login(loginForm);
        return Result.success(dto);
    }

    @PostMapping("/register")
    public Result register(@RequestBody LoginForm loginForm) {
        User user = userService.register(loginForm);
        return Result.success(user);
    }

    @GetMapping("/userinfo/{username}")
    public Result getUserInfoByName(@PathVariable String username) {
        User one = userService.getOne(username);
        return Result.success(one);
    }

    @GetMapping("/userid")
    public long getUserId() {
        return TokenUtils.getCurrentUser().getId();
    }

    @GetMapping("/user/")
    public Result findAll() {
        List<User> list = userService.list();
        return Result.success(list);
    }

    @PostMapping("/user")
    public Result save(@RequestBody User user) {

        return userService.saveUpdate(user);
    }

    @Authority(AuthorityType.requireAuthority)
    @DeleteMapping("/user/{id}")
    public Result deleteById(@PathVariable int id) {
        boolean isSuccessful = userService.removeById(id);
        if (isSuccessful) {
            return Result.success();
        } else {
            return Result.error(Constants.CODE_500, "删除失败");
        }
    }

    @Authority(AuthorityType.requireAuthority)
    @PostMapping("/user/del/batch")
    public Result deleteBatch(@RequestBody List<Integer> ids) {
        boolean isSuccessful = userService.removeBatchByIds(ids);
        if (isSuccessful) {
            return Result.success();
        } else {
            return Result.error(Constants.CODE_500, "删除失败");
        }
    }

    @GetMapping("/user/page")
    public Result findPage(@RequestParam int pageNum,
                           @RequestParam int pageSize,
                           String id,
                           String username,
                           String nickname) {
        IPage<User> userPage = new Page<>(pageNum, pageSize);
        QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
        if (!Util.isEmptyString(id)) {
            userQueryWrapper.like("id", id);
        }
        if (!Util.isEmptyString(username)) {
            userQueryWrapper.like("username", username);
        }
        if (!Util.isEmptyString(nickname)) {
            userQueryWrapper.like("nickname", nickname);
        }
        userQueryWrapper.orderByDesc("id");
        System.out.println("============" + TokenUtils.getCurrentUser());
        return Result.success(userService.page(userPage, userQueryWrapper));
    }

    /**
     * 重置密码
     *
     * @param id          用户id
     * @param newPassword 新密码
     * @return 结果
     */
    @GetMapping("/user/resetPassword")
    public Result resetPassword(@RequestParam String id, @RequestParam String newPassword) {
        userService.resetPassword(id, newPassword);
        return Result.success();
    }
}
<!--
 * @Description:
 * @Author: Rabbiter
 * @Date: 2023-03-26 15:27:05
-->
<template>
    <div id="bk" class="wrapper">
        <div class="login-box">
            <div class="title">
                <img
                    src="@/resource/03.png"
                    style="
                        width: 30px;
                        height: 30px;
                        margin: 0 5px -5px 0;
                        -webkit-user-drag: none;
                        -khtml-user-drag: none;
                        -moz-user-drag: none;
                        user-drag: none;
                    "
                />
                <b style="font-size: 28px"> 登录在线商城 </b>
            </div>
            <div style="margin-top: 30px">
                <el-form label-width="70px">
                    <el-form-item label="用户名">
                        <el-input
                            v-model.trim="user.username"
                            aria-required="true"
                        ></el-input>
                    </el-form-item>
                    <el-form-item label="密码" style="margin-top: 25px">
                        <el-input
                            v-model.trim="user.password"
                            show-password
                            aria-required="true"
                        ></el-input>
                    </el-form-item>
                    <el-form-item style="text-align: center">
                        <el-button
                            type="success"
                            @click="onSubmit"
                            style="font-size: 22px"
                        > 登录</el-button
                        >
                        <el-button
                            @click="$router.push('/register')"
                            style="font-size: 22px"
                        > 注册</el-button
                        >
                    </el-form-item>
                </el-form>
         

            </div>
        </div>
    </div>
</template>

<script>
import md5 from "js-md5";

export default {
    name: "Login",
    data() {
        return {
            to: "/", //登陆成功跳转的页面
            user: {},
        };
    },
    created() {
        this.to = this.$route.query.to ? this.$route.query.to : "/";
    },
    mounted() {

    },
    methods: {
        onSubmit() {
            if (this.user.username === "" || this.user.password === "") {
                this.$message.error("账号或密码不能为空");
                return false;
            }
            let form = {};
            Object.assign(form, this.user);
            form.password = md5(this.user.password);
            this.request
                .post("/login", form)
                .then((res) => {
                    if (res.code === "200") {
                        this.$message.success({
                            message: "登陆成功",
                            showClose: true,
                        });
                        this.$router.push(this.to);
                        localStorage.setItem("user", JSON.stringify(res.data));
                    } else {
                        this.$message.error(res.msg);
                    }
                })
                .catch((e) => {
                    console.log(e);
                    if (
                        e.response == undefined ||
                        e.response.data == undefined
                    ) {
                        this.$message({
                            showClose: true,
                            message: e,
                            type: "error",
                            duration: 5000,
                        });
                    } else {
                        this.$message({
                            showClose: true,
                            message: e.response.data,
                            type: "error",
                            duration: 5000,
                        });
                    }
                });
        },
    },
    updated() {

    }
};
</script>

<style scoped>
.wrapper {
    height: 100vh;
    background-color: rgb(161, 202, 220);
    overflow: auto;
}
.login-box {
    margin: 220px auto;
    padding: 40px;
    width: 450px;
    height: 280px;
    background-color: #ffffff;
    border-radius: 10px;
}
.title {
    text-align: center;
    margin: 30px auto;
    font-size: 25px;
}

#bk {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    overflow-y: auto;
    height: 100%;
    background: url("../resource/01.jpg") center top / cover no-repeat;
}
</style>

源码代码

链接:https://pan.baidu.com/s/1VuRLp12hnKA8aJcX6h2y7w 
提取码:1234

  • 24
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值