基于Java,SpringBoot,Vue,HTML宠物相亲配对婚恋系统设计

摘要

基于Java、SpringBoot、Vue和HTML的宠物相亲配对系统设计旨在为宠物主人打造一个高效、智能的宠物社交与配对平台。系统采用前后端分离架构,前端基于Vue.js框架结合HTML/CSS/JavaScript构建动态交互界面,实现宠物信息展示、用户社交互动等功能,通过Vue Router和Vuex分别管理路由与状态,确保用户操作流畅与数据共享便捷;后端以SpringBoot为核心,整合Spring MVC、MyBatis-Plus等组件,采用RESTful API规范实现业务逻辑处理与数据库交互,利用Spring Security保障系统安全认证与权限管理。数据层使用MySQL存储结构化数据,并通过索引优化与分表策略提升查询性能。系统核心功能涵盖个人中心、相亲公司管理、相亲案例管理、用户管理、相亲管理、轮播图管理等模块。该系统通过整合互联网技术与宠物社交场景,有效解决传统配对方式中信息不对称、地域限制强等问题,提升宠物社交效率与用户体验,为宠物行业智能化发展提供技术支撑。随着宠物饲养数量的增加,宠物主人对宠物社交和配对服务的需求愈发强烈。传统宠物配对方式存在信息不透明、匹配效率低等问题。为解决这些问题,设计并开发了基于 Java、SpringBoot、Vue 和 HTML 的宠物相亲配对系统。该系统采用前后端分离架构,前端运用 Vue.js 框架,结合 HTML、CSS 和 JavaScript 搭建动态交互界面,利用 Vue Router 进行路由管理,通过 Vuex 实现状态管理;后端以 SpringBoot 为核心,整合 Spring MVC 进行 Web 开发,使用 MyBatis-Plus 操作 MySQL 数据库,借助 Spring Security 保障系统安全。采用 RESTful API 规范实现前后端数据交互。

功能介绍

管理员、普通用户两种用户角色;

管理员:个人中心、相亲公司管理、相亲案例管理、用户管理、相亲管理、轮播图管理等;

普通用户:首页可以查看相亲公司和案例、进行相亲配对、个人中心、相应的后台管理等。

技术介绍

后端:Java语言的Spring Boot框架、MySQL数据库、Maven依赖管理等;

前端:管理员后台使用Vue、element-ui、axios等,用户前台使用HTML、layUI、element-ui等。

管理员登录界面代码

html 复制代码
<template>
    <div>
        <div class="container loginIn" style="backgroundImage: url(/xiangqinwangzhan/img/back-img-bg.jpg)">

            <div :class="2 == 1 ? 'left' : 2 == 2 ? 'left center' : 'left right'" style="backgroundColor: rgba(255, 255, 255, 0.71)">
                <el-form class="login-form" label-position="left" :label-width="1 == 3 ? '56px' : '0px'">
                    <div class="title-container"><h3 class="title" style="color: rgba(84, 88, 179, 1)">宠物相亲网站</h3></div>
                    <el-form-item :label="1 == 3 ? '用户名' : ''" :class="'style'+1">
                        <span v-if="1 != 3" class="svg-container" style="color:rgba(89, 97, 102, 1);line-height:44px"><svg-icon icon-class="user" /></span>
                        <el-input placeholder="请输入用户名" name="username" type="text" v-model="rulesForm.username" />
                    </el-form-item>
                    <el-form-item :label="1 == 3 ? '密码' : ''" :class="'style'+1">
                        <span v-if="1 != 3" class="svg-container" style="color:rgba(89, 97, 102, 1);line-height:44px"><svg-icon icon-class="password" /></span>
                        <el-input placeholder="请输入密码" name="password" type="password" v-model="rulesForm.password" />
                    </el-form-item>
                    <el-form-item v-if="0 == '1'" class="code" :label="1 == 3 ? '验证码' : ''" :class="'style'+1">
                        <span v-if="1 != 3" class="svg-container" style="color:rgba(89, 97, 102, 1);line-height:44px"><svg-icon icon-class="code" /></span>
                        <el-input placeholder="请输入验证码" name="code" type="text" v-model="rulesForm.code" />
                        <div class="getCodeBt" @click="getRandCode(4)" style="height:44px;line-height:44px">
                            <span v-for="(item, index) in codes" :key="index" :style="{color:item.color,transform:item.rotate,fontSize:item.size}">{{ item.num }}</span>
                        </div>
                    </el-form-item>
                    <el-form-item label="角色" prop="loginInRole" class="role">
                        <el-radio
                                v-for="item in menus"
                                v-if="item.hasBackLogin=='是'"
                                v-bind:key="item.roleName"
                                v-model="rulesForm.role"
                                :label="item.roleName"
                        >{{item.roleName}}</el-radio>
                    </el-form-item>
                    <el-button type="primary" @click="login()" class="loginInBt" style="padding:0;font-size:16px;border-radius:4px;height:44px;line-height:44px;width:100%;backgroundColor:rgba(84, 88, 179, 1); borderColor:rgba(84, 88, 179, 1); color:rgba(255, 255, 255, 1)">{{'1' == '1' ? '登录' : 'login'}}</el-button>
                    <el-form-item class="setting">
            <div class="register" @click="register('yonghu')">用户注册</div>
                    </el-form-item>
                </el-form>
            </div>

        </div>
    </div>
</template>
<script>
    import menu from "@/utils/menu";
    export default {
        data() {
            return {
                rulesForm: {
                    username: "",
                    password: "",
                    role: "",
                    code: '',
                },
                menus: [],
                tableName: "",
                codes: [{
                    num: 1,
                    color: '#000',
                    rotate: '10deg',
                    size: '16px'
                },{
                    num: 2,
                    color: '#000',
                    rotate: '10deg',
                    size: '16px'
                },{
                    num: 3,
                    color: '#000',
                    rotate: '10deg',
                    size: '16px'
                },{
                    num: 4,
                    color: '#000',
                    rotate: '10deg',
                    size: '16px'
                }],
            };
        },
        mounted() {
            let menus = menu.list();
            this.menus = menus;
        },
        created() {
            this.setInputColor()
            this.getRandCode()
        },
        methods: {
            setInputColor(){
                this.$nextTick(()=>{
                    document.querySelectorAll('.loginIn .el-input__inner').forEach(el=>{
                        el.style.backgroundColor = "rgba(255, 255, 255, 1)"
                        el.style.color = "rgba(0, 0, 0, 1)"
                        el.style.height = "44px"
                        el.style.lineHeight = "44px"
                        el.style.borderRadius = "2px"
                    })
                    document.querySelectorAll('.loginIn .style3 .el-form-item__label').forEach(el=>{
                        el.style.height = "44px"
                        el.style.lineHeight = "44px"
                    })
                    document.querySelectorAll('.loginIn .el-form-item__label').forEach(el=>{
                        el.style.color = "rgba(89, 97, 102, 1)"
                    })
                    setTimeout(()=>{
                        document.querySelectorAll('.loginIn .role .el-radio__label').forEach(el=>{
                            el.style.color = "rgba(84, 88, 179, 1)"
                        })
                    },350)
                })

            },
            register(tableName){
                this.$storage.set("loginTable", tableName);
                this.$router.push({path:'/register'})
            },
            // 登陆
            login() {
                let code = ''
                for(let i in this.codes) {
                    code += this.codes[i].num
                }
                if ('0' == '1' && !this.rulesForm.code) {
                    this.$message.error("请输入验证码");
                    return;
                }
                if ('0' == '1' && this.rulesForm.code.toLowerCase() != code.toLowerCase()) {
                    this.$message.error("验证码输入有误");
                    this.getRandCode()
                    return;
                }
                if (!this.rulesForm.username) {
                    this.$message.error("请输入用户名");
                    return;
                }
                if (!this.rulesForm.password) {
                    this.$message.error("请输入密码");
                    return;
                }
                if (!this.rulesForm.role) {
                    this.$message.error("请选择角色");
                    return;
                }
                let menus = this.menus;
                for (let i = 0; i < menus.length; i++) {
                    if (menus[i].roleName == this.rulesForm.role) {
                        this.tableName = menus[i].tableName;
                    }
                }
                this.$http({
                    url: `${this.tableName}/login?username=${this.rulesForm.username}&password=${this.rulesForm.password}`,
                    method: "post"
                }).then(({ data }) => {
                    if (data && data.code === 0) {
                        this.$storage.set("Token", data.token);
                        this.$storage.set("userId", data.userId);
                        this.$storage.set("role", this.rulesForm.role);
                        this.$storage.set("sessionTable", this.tableName);
                        this.$storage.set("adminName", this.rulesForm.username);
                        this.$router.replace({ path: "/index/" });
                    } else {
                        this.$message.error(data.msg);
                    }
                });
            },
            getRandCode(len = 4){
                this.randomString(len)
            },
            randomString(len = 4) {
                let chars = [
                    "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
                    "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
                    "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G",
                    "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R",
                    "S", "T", "U", "V", "W", "X", "Y", "Z", "0", "1", "2",
                    "3", "4", "5", "6", "7", "8", "9"
                ]
                let colors = ["0", "1", "2","3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"]
                let sizes = ['14', '15', '16', '17', '18']

                let output = [];
                for (let i = 0; i < len; i++) {
                    // 随机验证码
                    let key = Math.floor(Math.random()*chars.length)
                    this.codes[i].num = chars[key]
                    // 随机验证码颜色
                    let code = '#'
                    for (let j = 0; j < 6; j++) {
                        let key = Math.floor(Math.random()*colors.length)
                        code += colors[key]
                    }
                    this.codes[i].color = code
                    // 随机验证码方向
                    let rotate = Math.floor(Math.random()*60)
                    let plus = Math.floor(Math.random()*2)
                    if(plus == 1) rotate = '-'+rotate
                    this.codes[i].rotate = 'rotate('+rotate+'deg)'
                    // 随机验证码字体大小
                    let size = Math.floor(Math.random()*sizes.length)
                    this.codes[i].size = sizes[size]+'px'
                }
            },
        }
    };
</script>

演示视频

Java,SpringBoot,Vue,HTML宠物相亲系统

相关推荐
淬渊阁6 分钟前
Go package
java·开发语言
vvilkim10 分钟前
React 与 Vue 虚拟 DOM 实现原理深度对比:从理论到实践
前端·vue.js·react.js
CoderCodingNo16 分钟前
【GESP】C++二级真题 luogu-B4259 [GESP202503 二级] 等差矩阵
java·c++·矩阵
佳腾_30 分钟前
【Web应用服务器_Tomcat】二、Tomcat 核心配置与集群搭建
java·前端·中间件·tomcat·web应用服务器
聂 可 以30 分钟前
IntelliJ IDEA修改实体类成员变量的名称(引入了该实体类的全部文件也会自动更新变量的名称)
java·ide·intellij-idea
冰茶_32 分钟前
C#中常见的设计模式
java·开发语言·microsoft·设计模式·微软·c#·命令模式
.似水1 小时前
2025.4.22_C_可变参数列表
java·c语言·算法
禅与Bug的修复艺术1 小时前
JAVA后端开发常用的LINUX命令总结
java·linux·面试·java面试·后端开发·java后端·面试经验
佩奇的技术笔记1 小时前
Java学习手册:Java开发常用的内置工具类包
java
MaCa .BaKa1 小时前
35-疫苗预约管理系统(微服务)
spring boot·redis·微服务·云原生·架构·springcloud