[免费]SpringBoot+Vue疫情防控管理系统【论文+源码+SQL脚本】

大家好,我是java1234_小锋老师,看到一个不错的SpringBoot+Vue疫情防控管理系统,分享下哈。

项目视频演示

【免费】SpringBoot+Vue疫情防控管理系统 Java毕业设计_哔哩哔哩_bilibili

项目介绍

现代经济快节奏发展以及不断完善升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本疫情防控管理系统就是在这样的大环境下诞生,其可以帮助管理者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以帮助管理人员提高事务处理效率,达到事半功倍的效果。此疫情防控管理系统利用当下成熟完善的springBoot框架,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的Mysql数据库进行程序开发.疫情防控管理系统的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。

系统展示

部分代码

package com.rabbiter.ppm.controller;


import com.rabbiter.ppm.entity.User;
import com.rabbiter.ppm.service.UserService;
import com.rabbiter.ppm.utils.BaseApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.Map;

@RestController
@RequestMapping("/userlogin")
public class LoginController {

    @Autowired
    UserService userService;

    @PostMapping("/user")
    public Map<String, Object> login(@RequestBody User loginform, HttpSession session, HttpServletRequest request, HttpServletResponse response) {
        User user = userService.login(loginform, request, response);
        if(user == null) {
            return BaseApi.error("用户名或密码错误");
        }
        user.setPassword(null);
        session.setAttribute("user", user);
        return BaseApi.success(user);
    }

    @GetMapping("/getUser")
    public Map<String, Object> getUser(HttpSession session) {
        User user = (User) session.getAttribute("user");
        if(user == null) {
            return BaseApi.error("登录信息过期");
        }
        return BaseApi.success(user);
    }

    @PostMapping("/register")
    public String register(@RequestBody User reUser) {

        String message = userService.register(reUser);
        return message;
    }

    @GetMapping("/logout")
    public Map<String, Object> logout(HttpSession session) {
        session.removeAttribute("user");
        return BaseApi.success();
    }
}
<template>
    <div>
        <div id="loginBk"></div>
        <el-card class="login-form-layout" style="opacity: 0.95">
            <el-form
                autocomplete="on"
                :model="loginForm"
                ref="loginForm"
                label-position="left"
            >
                <h2 class="login-title color-main">疫情防控管理系统登录</h2>
                <el-form-item prop="username">
                    <el-input
                        name="username"
                        type="text"
                        v-model="loginForm.username"
                        autocomplete="on"
                        placeholder="请输入用户名"
                    >
                        <template slot="prepend">
                            <i
                                class="iconfont icon-r-user2"
                                style="font-size: 24px; color: grey"
                            ></i>
                        </template>
                    </el-input>
                </el-form-item>
                <el-form-item prop="password">
                    <el-input
                        name="password"
                        :type="pwdType"
                        @keyup.enter.native="handleLogin"
                        v-model="loginForm.password"
                        autocomplete="on"
                        placeholder="请输入密码"
                        show-password
                    >
                        <template slot="prepend">
                            <i
                                class="iconfont icon-r-lock"
                                style="font-size: 24px; color: grey"
                            ></i>
                        </template>
                    </el-input>
                </el-form-item>
                <el-form-item style="margin-bottom: 60px">
                    <el-button
                        style="width: 48%"
                        type="primary"
                        :loading="loading"
                        @click.native.prevent="handleLogin"
                        > 登录</el-button
                    >
                    <el-button
                        style="width: 48%"
                        type="success"
                        :loading="loading"
                        @click="dialogFormVisible = true"
                        > 注册</el-button
                    >
                  <a href="http://www.java1234.com/a/bysj/javaweb/" target='_blank'><font color=red>Java1234收藏整理</font></a>

                </el-form-item>
            </el-form>
        </el-card>

        <el-dialog title="用户注册" :visible.sync="dialogFormVisible" center="">
            <el-form :model="user">
                <el-form-item label="用户名" :label-width="formLabelWidth">
                    <el-input
                        v-model="user.username"
                        autocomplete="off"
                        size="small"
                        :label-width="LabelWidth"
                    ></el-input>
                </el-form-item>
                <el-form-item label="密码" :label-width="formLabelWidth">
                    <el-input
                        show-password
                        :type="pwdType"
                        v-model="user.password"
                        autocomplete="off"
                    ></el-input>
                </el-form-item>
                <el-form-item label="确认密码" :label-width="formLabelWidth">
                    <el-input
                        show-password
                        :type="pwdType"
                        v-model="user.repassword"
                        autocomplete="off"
                    ></el-input>
                </el-form-item>
                <el-form-item label="所属组织" :label-width="formLabelWidth">
                    <el-select
                        v-model="user.depart"
                        clearable
                        placeholder="请选择"
                    >
                        <el-option
                            v-for="(item, index) in options2"
                            :key="index"
                            :label="item"
                            :value="item"
                        >
                        </el-option>
                    </el-select>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="dialogFormVisible = false"> 取 消</el-button>
                <el-button type="primary" @click="register()"> 确 定</el-button>
            </div>

        </el-dialog>
    </div>
</template>
 
<script>
export default {
    created() {
        axios
            .get(this.$store.state.baseApi + "/depart/findAll")
            .then((resp) => {
                this.options2 = resp.data;
            });
    },
    name: "login",
    data() {
        return {
            options2: [
                {
                    value: "",
                    label: "",
                },
            ],
            formLabelWidth: "120px",
            LabelWidth: "40px",
            dialogFormVisible: false,
            user: {
                username: "",
                password: "",
                repassword: "",
                depart: "",
            },
            loginForm: {
                username: "",
                password: "",
            },
            loading: false,
            pwdType: "password",
        };
    },
    methods: {
        register() {
            this.dialogFormVisible = false;
            if (this.user.username == "" || this.user.password == "") {
                this.$alert("注册用户名或密码不能为空");
                this.loading = false;
            } else if (this.user.password == this.user.repassword) {
                axios
                    .post(
                        this.$store.state.baseApi + "/userlogin/register",
                        this.user
                    )
                    .then((resp) => {
                        console.log(resp);
                        this.loading = true;
                        if (resp.data == "success") {
                            this.loading = false;
                            this.$alert("注册成功!请登录");
                        } else if (resp.data == "repeat") {
                            this.loading = false;
                            this.$alert("用户名已存在!请重新注册");
                        } else {
                            this.loading = false;
                            this.$alert("注册失败!请重新注册");
                            window.location.reload();
                        }
                    });
            } else {
                this.$alert("两次输入的密码不一致!");
            }
        },
        showPwd() {
            if (this.pwdType === "password") {
                this.pwdType = "";
            } else {
                this.pwdType = "password";
            }
        },
        handleLogin() {
            axios
                .post(
                    this.$store.state.baseApi + "/userlogin/user",
                    this.loginForm
                )
                .then((resp) => {
                    console.log(resp);
                    this.loading = true;
                    if (
                        this.loginForm.username == "" ||
                        this.loginForm.password == ""
                    ) {
                        this.$alert("用户名或密码不能为空");
                        this.loading = false;
                    } else {
                        var map = resp.data;
                        if (map.code === "200") {
                            this.loading = false;
                            // 保存用户信息
                            this.$store.state.user = map.data;
                            this.$message({
                                showClose: true,
                                message: "登录成功",
                                type: "success",
                            });
                            this.$router.push("/Announcement");
                        } else {
                            this.loading = false;
                            this.$message({
                                showClose: true,
                                message: map.msg,
                                type: "error",
                            });
                        }
                    }
                })
                .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,
                        });
                    }
                });
        },
    },
};
</script>
 
<style scoped>
.login-form-layout {
    position: absolute;
    left: 0;
    right: 0;
    width: 360px;
    margin: 140px auto;
    border-top: 10px solid #409eff;
}

.login-title {
    text-align: center;
}

.login-center-layout {
    background: #409eff;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin-top: 200px;
}

#loginBk {
    background: url("~@/assets/login.jpg") no-repeat;
    background-size: 100% 100%;
    position: absolute;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
}
</style>

源码代码

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

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值