Advertisement

如何使用ssm实现基于ssm的宠物医院管理系统的设计与实现+vue

阅读量:

@TOC

ssm236基于ssm的宠物医院管理系统的设计与实现+vue

系统概述

1.1 研究背景

当前全球 internet 发展迅速, 全球范围内广泛存在网络, 利用 internet 发布的消息能够快速便捷地覆盖全球各个角落, 同时在线上传播的信息也非常丰富, 包括文字、图片、声音与视频等多种形式. 正是由于这些优势的存在, internet 成为了信息传播的重要传输渠道, 各类信息都致力于通过这一平台实现最大范围的分享与交流, 而 internet 对现代社会的影响也日益显著

伴随着计算机技术的发展以及计算机网络的日益普及,在这个信息时代下

1.2研究目的

伴随着互联网技术的迅猛发展

各行各业在日常企业经营管理方面

宠物医院管理系统的信息化程度

无疑

信息交流更迅速

机构必须转型采用电子化记账系统以避免落后趋势。然而这一转型过程将导致工作效率显著下降,并且随着时间推移相关数据难以长期存储引发一系列操作挑战包括查询维护等日常功能受限况下数据交换过程还存在风险若非及时推进则可能严重影响整体业务效能因此建立专业的宠物医院管理系统势在必行不仅有助于提升企业的技术形象更能增强其在信息技术领域的竞争力

1.3系统设计思想

要想建立一个成功的 Website 首先需明确其建设目标 并且要清楚地规划其功能定位 同时还需要规划其规模大小及所需投入费用 并进行必要的市场调研工作 只有制定出一套详实可行的规划方案 才能规避诸多网站建设中的潜在问题 从而使整个 Website 建设过程得以顺利推进 基于现实生活中网民的实际需求 本系统的设计必须严格遵循以下原则

  1. 有效性:实际上这里的有效性包括两个方面的意思:有用性和可用性。有用性是指站点潜在的能满足员工用户需求的功能,而可用性是指能够通过站点的操作实现特定的目标。可以看出一个站点如果不能恰当运行或设计得非常槽糕就不是一个好站点。可用站点的效益应该非常高,并易于学习,在实现员工用户目标时令人满意而不出错。
  2. 高可靠性:一个实用的网站同时必须是可靠的,本设计通过合理而先进的网络设计以及软、硬件的优化选型,可保证网站的可靠性与容错性。
  3. 高安全性:在设计中,将充分利用网络软、硬件提供的各种安全措施,既可以保证员工用户共享资源,充分考虑系统及数据资源的容灾、备份、恢复的要求。为系统提供强大的数据库备份工具。可以保证关键数据的安全性。操作权限级,设置不同的角色确保每一步的操作权限,可以由管理员进行设置。
  4. 先进性:采用目前国际上最先进的开发技术,使用JSP开发技术,MYSQL作为网站后台数据库。采用这些技术降低了以后的系统运营成本,提高了系统的稳定性和易维护性。
  5. 采用标准技术:本网站的所有设计遵循国际上现行的标准进行,以提高系统的开放性。
  6. 外观和技术平衡:系统采用Web风格的界面设计,界面友好、美观,使用方便,易学易用。网站设计的关键问题是外观和技术的平衡。外现不好的网站令人厌烦,站点可以运行很好,但却不能带动员工用户积极性,相反,如果外观非常有表现力,但技术有限,员工用户则会感到非常失望。在外观与技术之间需要确定一个清晰而连续的关系,即外观与站点的意图相关,对不同类型的网站处理方法不同。

2相关技术

2.1 MYSQL数据库

MySQL是一个经典的关系型数据库服务器系统。它遵循客户/服务器模式,并支持多种功能强大的功能。其特点包括易于学习和使用的界面以及高效的管理能力。该系统具备高度的安全性和可靠性,在运行速度方面表现优异,并且能够同时处理多个事务(高并发处理能力)。MySQL非常适合用于Web站点或其他应用软件的需求。开发人员可使用多种编程语言与MySQL数据库建立交互(访问)。作为开放源代码理念下的产物之一,MySQL如今已成为广受欢迎的关系型数据库管理系统,在应用领域不断扩大。(扩展)其优势在于快速响应需求的同时提供稳定可靠的解决方案(显著提升性能)。

MYSQL数据库具有以下特点:

1、C和C ++中使用和测试,以确保源代码的编译器的便携性和灵活性。

支持多种操作系统如AIX、FreeBSD、HP-UX、Linux及Mac OS等的;包括Novell公司的Netware;还有OpenBSD系统;以及OS/2版本;此外还有Solaris及Windows等系统

3、为此目的而提供的API旨在支持多种编程语言的功能实现。这些编程语言包括C, C++, Python, Java等;此外还包括 Perl, PHP 和埃菲尔铁塔(即Eiffel),以及 Ruby 和 Tcl 等其他相关技术。

4、以及使用的CPU资源来支持多线程。

5、算法优化查询SQL,切实提高搜索速度。

6、网络上的客户端和服务端可用于开发任何独立的编程环境,并提供包括ANSI码字节(ANSI)、简体中文(Unicode)、GB2312编码标准、BIG5编码标准以及日文字符集代码(Unicode),通常用于实现多国语言支持,并可嵌入到数据表以及其他软件中的字符集访问列中作为命名空间使用

7、TCP / IP,ODBC和JDBC数据库,并提供连接到其他。

8、管理工具的管理,控制和优化数据库的操作。

9、可以数以千万计的记录在一个大的数据库。

2.2 B/S结构

基于互联网系统的软件系统开发架构是一种典型的B/S架构设计模式,在当前软件系统开发领域得到了广泛应用并逐渐占据主导地位

B/S架构借助于操作系统的浏览器来实现功能,并非基于窗体界面的软件类型。无需在被使用的计算机上进行本地安装即可运行。B/S架构通过将开发的软件系统部署到远程服务器实现了远程访问的能力,在任何接入互联网的情况下都可以方便地访问这些服务配置。该架构显著提升了管理人员通过网络访问系统的能力。

采用三层架构设计的B/S(Browser代表浏览器)系统中

随着B/S架构的持续发展和完善,在线浏览技术得到了广泛应用,并融合多种浏览器脚本语言使其功能更加强大。这种架构通过利用通用浏览器实现了原本需要复杂专用软件才能完成的功能,并显著降低了开发成本。它代表了一种新型的软件架构设计。该系统包含三个关键层面:表示逻辑层、控制逻辑层和数据展示层。这三个层面在结构上相互独立却又相互关联。

2.3 SSM框架简介

SSM体系架构代表了Spring技术家族中的核心组件组合...MyBatis... Spring MVC... 的精妙结合与优化整合方案,在当前开发环境中具有较高的知名度和应用价值。这一项技术体系不仅继承并提升了传统面向服务架构(SOA)的技术特点与实现模式... 同时也在实践中形成了独特的开发理念和设计规范。被广泛应用于开发功能复杂的企业级应用系统

1.Spring简介

开源框架Spring诞生于2003年份,在其创始人Rod Johnson所著《Expert One-On-One J2EE Development and Design》一书中所阐述的核心理念与设计原型基础上发展而来。它旨在简化企业应用开发过程中的复杂性。基于IoC实现以前只能通过EJB完成的功能,在实际应用中,Spring的应用不仅局限于Web服务器端。从易用性、测试友好性和松耦合的角度来看,任何基于Java的应用程序都能从中受益。简单来说,Spring作为一个轻量级的支持控制反转(IoC)和面向切面(AOP)功能的核心容器框架。

A.控制反转(IOC)是什么呢?

IOC:逆向构造也称为依赖注入。通过工厂模式将对象交由容器进行管理,在Spring框架中,默认情况下已经为你预先配置好了所需的Bean(即Bean对像)。你可以只需在Spring的配置文件中配置相应的Bean即可,并设置相关的属性参数。Spring会自动生成这些类实例,并由其管理对象间的关系。当Spring容器启动时,Spring会自动初始化所有被配置好的Bean(即从你的应用逻辑中提取出的所有需要被管理的对象)。随后,在需要调用的时候——将它们分配给相应类(假设这个类名是A)的方法,则通过调用该类A的setter方法来进行注入操作。这样就不必再手动new出这些Bean了

B.面向切面(AOP)又是什么呢?

首先需要说明的是,在Spring框架中,AOP(面向切面编程)确实是一种编程思想,它与OOP(面向对象编程)并行存在,并不构成特定的技术实现,AOP实质上是对OOP的一种补充和完善机制.在OOP设计模式中,封装、继承和多态性等概念被用来构建对象层次结构,以模拟公共行为集合.然而,OOP在处理分散对象间的共享行为时显得力不从心.具体而言,当我们需要将分散的对象引入公共行为时,OOP提供了从上至下的继承关系定义能力,但无法自然支持从左至右的行为交互方式.举个例子来说,日志功能往往会在各个对象层次中水平分布,这些日志代码与其所关联的对象的核心业务逻辑之间并无直接联系.这种分布导致了大量重复代码的出现,不利于模块间的可复用性和扩展性.因此,为了避免这种冗余问题,AOP被提出并应用到目标对象(如具体业务逻辑)中去

该技术主要包括两类方法:一种是基于动态代理的技术,在这种方案下信息被截取后并被装饰处理以替代原有对象的行为执行过程;另一种则是通过静态集成特定语法生成"面"代码,并在编译阶段嵌入与"面"相关的核心逻辑和数据结构。

2.Spring MVC简介

Spring MVC源自Spring Framework这一系列后续产品,并已在Spring Web Flow中实现了整合。它内置了Spring框架的核心特性,在降低开发复杂度的同时提供了规范化的开发流程。该系统通过明确划分控制器角色、模型对象角色、分派器角色以及处理程序对象角色等职责范围,在设计上实现了对各组件功能的有效分离与独立配置能力。

3.MyBatis简介

MyBats原本是Apache的一个开源项目iBats,在2010年时由Apache Software Foundation迁移到了Google Code并更名为MyBats。
该框架提供了一个基于Java的持久层架构。
它消除了大量传统的JDBC代码和手动配置参数以及结果集操作。
通过简单的XML配置或注解实现接口与Java对象与数据库表的一一映射关系。
该框架能够帮助开发者轻松管理数据增删查改操作。

3系统分析

3.1可行性分析

对本宠物医院管理系统实施目的的调查与分析的基础上制定出一系列可行方案,并对每个方案逐一进行了详细论证研究。在本系统中主要从技术可行性方面展开探讨,并结合经济可行性和操作性等多方面因素综合考虑

3.1.1技术可行性

该宠物医院管理系统的开发项目基于JAVA语言作为核心编程语言,并采用Spring Boot框架实现;同时该系统采用B/S架构设计,并基于Web技术构建。

Java具备了可靠的性能、良好的可升级性、更快捷的开发方式、更加容易的管理系统以及全新的语言功能和配套服务。该系统由公司负责处理了大部分不重要的琐碎任务。

(2)基于B/S模式的系统的开发已发展日趋成熟。

(3)广为人知的是Java属于一种面向对象的编程语言。软件开发者可以在Eclipse平台上容易地使用一些现有的解决方案。

由此可见,在开发宠物医院管理系统的技术方面具有较高的可行性,并且开发团队具备一定的技术能力,由此可见该系统的开发技术确实具备可行性。

3.1.2经济可行性

该宠物医院管理系统的软件均为开源性质。这不仅降低了开发成本,并且显著减少了所需的人力物力。其对计算机硬件的要求极为宽松,在这种情况下即使使用老旧设备也能满足基本需求。因此,在经济方面该系统的可行性无可置疑,在经济领域同样具备高度可行性

3.1.3操作可行性

该系统的界面设计简单直观。对于熟悉使用电脑的员工而言,进入并完成各项操作相对简便。该系统具备易于使用的特点:易于操作与管理,并且互动性强。其特点是便于使用和执行。这一特点使得其具备良好的适用性。

总体而言,本系统的开发目标已经非常明确。涵盖技术、经济及操作等多个方面的可行性分析表明,在投入较少的同时具备完整功能且管理便捷的情况下完成本系统的开发无疑是可行的。

3.2系统性能分析

3.2.1 系统安全性

此宠物医院管理系统要严格控制管理权限,具体要求如下:

为了实现宠物医院管理系统的人工智能管控功能, 必须要求所有人员使用合法有效的账号(即包含用户名与密码)登录系统。对于无权访问的用户提供者来说, 他们无法以任何形式进入系统或查看其中的信息与数据。这些严格的权限控制措施能够有效保障系统的安全运行, 并确保其操作的准确性和可靠性。

在具体实施过程中为各类不同的权限设置相应的策略,在系统运行期间禁止各类岗位的人员进行越权操作。

3.2.2 数据完整性

(1)所有记录信息要保持全面,信息记录内容不可以是空。

(2)各种数据间相互联系要保持正确。

(3)相同数据在不同记录中要保持一致。

3.3系统界面分析

当下

1.输出设计

该系统通过电脑处理输入的基本信息来生成结果,并按照一定的格式呈现这些数据以便于管理层进行决策分析和管理操作。其主要职责是确保输出的质量和适用性,并为管理层提供支持所需的信息

系统构建流程与其实施过程存在反向关系,在开发过程中并非按照传统的从输入端至输出端的设计思路展开;相反地,则是从输出端回溯至输入端进行规划与实现。这种做法的根本原因在于输出表格直接与使用者保持密切联系,在设计目标上应当确保使用者能够便捷地操作此表格,并能及时反馈各部门所需的信息。在制定输出设计标准时需兼顾各管理层的需求考量的同时也要做到简洁明了切勿冗余提供无用信息

2.输入设计

输入数据的收集与录入工作较为费时且耗人,在现有条件下难以避免失误。若系统中存在输入错误,则会导致后续处理结果进一步扩大这些偏差的影响程度;因此必须确保原始数据具有高度准确性以保证整个系统的正常运转效率

输入设计有以下几点原则:

为了确保系统的高效运行, 建议尽可能维持最低标准下的输入数据总量. 当输入数据减少时, 系统的运行效率和所需的数据预处理时间也会随之降低.

为了在操作过程中尽可能让输入前的准备以及执行过程变得较为简便流畅, 从而有效降低了错误的发生率

应尽早核查输入数据(尽量接近发生位置),以便及时纠正错误。

输入数据应尽快地转换为便于处理的形式, 以防止在数据从一种介质转移到另一种介质时需要进行转录而导致的错误

3.4系统流程和逻辑

图3-3登录流程图

图3-4修改密码流程图

4系统概要设计

4.1概述

本系统由Browser/Server配置及基于Web服务架构组成的混合模式构成,在互联网环境下构建了高效的服务体系模型;无论网络环境如何变化均可实现无缝对接;无需网络连接即可灵活操作,在任意时间和地点均可开展工作流程;系统工作原理图如图4-1所示

图4-1系统工作原理图

4.2系统结构

本系统是基于B/S架构的网站系统,设计的功能结构图如下图所示:

图4-2功能结构图

4.3.数据库设计

4.3.1数据库实体

概念设计的主要目标是生成一个能够体现某个组织部门信息需求的数据库系统概念模式。该数据库系统概念模式不受存储过程影响,并不依赖于DBMS的选择或计算机系统的具体配置。

基于需求分析的框架下

  1. 网站公告信息的实体属性图如下:

图4.12 网站公告信息实体属性图

(2)用户实体属性图如图4.13所示:

图4.13 用户实体属性图

(3)管理员实体属性图如图4.14所示:

图4.14 管理员实体属性图

4.3.2数据库设计表

宠物医院管理系统依赖先进的后端数据库系统作为支撑。本节将详细介绍数据库中的各个表的详细信息。

表4.1 宠物信息

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
chongwubianhao varchar(200) NULL 宠物编号
chongwumingcheng varchar(200) 宠物名称
pinzhong varchar(200) 品种
tupian varchar(200) NULL 图片
nianling int(11) NULL 年龄
chongwuxiangqing longtext NULL 宠物详情
clicktime datetime NULL 最近点击时间
clicknum int(11) 0 点击次数

表4.2 宠物论坛

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
title varchar(200) NULL 帖子标题
content longtext 帖子内容
parentid bigint(20) NULL 父节点id
userid bigint(20) 用户id
username varchar(200) NULL 用户名
isdone varchar(200) NULL 状态

表4.3 挂号预约

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
shouling int(11) NULL 兽龄
chongwuxinxi longtext NULL 宠物信息
yishengxingming varchar(200) NULL 医生姓名
yuyueshijian datetime NULL 预约时间
yonghuming varchar(200) 用户名
xingming varchar(200) NULL 姓名
sfsh varchar(200) 是否审核
shhf longtext NULL 审核回复

表4.4 寄养

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
yonghuming varchar(200) NULL 用户名
xingming varchar(200) NULL 姓名
chongwumingcheng varchar(200) NULL 宠物名称
shouling varchar(200) NULL 兽龄
chongwuxiangqing longtext NULL 宠物详情
riqi date NULL 日期
sfsh varchar(200) 是否审核
shhf longtext NULL 审核回复

表4.5 寄养结果

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
yonghuming varchar(200) NULL 用户名
xingming varchar(200) NULL 姓名
chongwumingcheng varchar(200) NULL 宠物名称
lingyangriqi datetime NULL 领养日期
jiyangjieguo varchar(200) NULL 寄养结果
lingyangrenxingming varchar(200) NULL 领养人姓名
lianxifangshi varchar(200) NULL 联系方式

表4.5 领养

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
yonghuming varchar(200) NULL 用户名
xingming varchar(200) NULL 姓名
chongwubianhao varchar(200) NULL 宠物编号
chongwumingcheng varchar(200) NULL 宠物名称
riqi datetime NULL 日期
sfsh varchar(200) 是否审核
shhf longtext NULL 审核回复

表4.7 网站公告

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
title varchar(200) 标题
introduction longtext NULL 简介
picture varchar(200) 图片
content longtext 内容

表4.8 收藏表

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
userid bigint(20) 用户id
refid bigint(20) NULL 收藏id
tablename varchar(200) NULL 表名
name varchar(200) 收藏名称
picture varchar(200) 收藏图片

表4.9 管理员表

字段 类型 默认 注释
id (主键) bigint(20) 主键
username varchar(100) 用户名
password varchar(100) 密码
role varchar(100) 管理员 角色
addtime timestamp CURRENT_TIMESTAMP 新增时间

表4.10 医生信息

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
yishengxingming varchar(200) NULL 医生姓名
zhicheng varchar(200) NULL 职称
xingbie varchar(200) NULL 性别
yishengjianjie longtext NULL 医生简介
lianxidianhua varchar(200) NULL 联系电话
youxiang varchar(200) NULL 邮箱
zhaopian varchar(200) NULL 照片

表4.11 用户

字段 类型 默认 注释
id (主键) bigint(20) 主键
addtime timestamp CURRENT_TIMESTAMP 创建时间
yonghuming varchar(200) 用户名
mima varchar(200) 密码
xingming varchar(200) 姓名
xingbie varchar(200) NULL 性别
nianling int(11) NULL 年龄
shouji varchar(200) NULL 手机
youxiang varchar(200) NULL 邮箱
touxiang varchar(200) NULL 头像
打开新的 phpMyAdmin 窗口

5系统详细实现

5.1 管理员模块的实现

5.1.1 用户信息管理

管理员能够完成用户的增删改查操作,在界面上提供相应的功能入口

图5.1 用户信息管理界面

5.1.2 宠物信息管理

系统管理员可以对宠物信息进行添加修改删除操作。具体界面如图5.2所示。

图5.2 宠物信息管理界面

5.1.3 医生信息管理

管理员可以对医生信息进行添加修改删除操作。界面如下图所示:

图5.3 医生信息界面

5.2 用户模块的实现

5.2.1 领养

用户登录后可以在宠物信息进行领养。界面如下图所示:

图5.4 领养界面

5.2.2 宠物论坛

用户在宠物论坛发布信息。界面如下图所示:

图5.5 宠物论坛界面

5.2.3 我的领养

用户登录后可以在领养里面查看自己领养是否通过。界面如下图所示:

图5.6 我的领养界面

ChongwuxinxiController.java
复制代码
    package com.controller;
    
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Calendar;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Date;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    
    import com.utils.ValidatorUtils;
    import org.apache.commons.lang3.StringUtils;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.format.annotation.DateTimeFormat;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;
    import org.springframework.web.bind.annotation.RestController;
    import com.baomidou.mybatisplus.mapper.EntityWrapper;
    import com.baomidou.mybatisplus.mapper.Wrapper;
    import com.annotation.IgnoreAuth;
    
    import com.entity.ChongwuxinxiEntity;
    import com.entity.view.ChongwuxinxiView;
    
    import com.service.ChongwuxinxiService;
    import com.service.TokenService;
    import com.utils.PageUtils;
    import com.utils.R;
    import com.utils.MD5Util;
    import com.utils.MPUtil;
    import com.utils.CommonUtil;
    
    
    /** * 宠物信息
     * 后端接口
     * @author 
     * @email 
     * @date 2021-04-15 20:04:19
     */
    @RestController
    @RequestMapping("/chongwuxinxi")
    public class ChongwuxinxiController {
    @Autowired
    private ChongwuxinxiService chongwuxinxiService;
    
    
    
    /** * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi, 
    		HttpServletRequest request){
    
        EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();
    		PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /** * 前端列表
     */
    	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){
        EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();
    		PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    	/** * 列表
     */
    @RequestMapping("/lists")
    public R list( ChongwuxinxiEntity chongwuxinxi){
       	EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( chongwuxinxi, "chongwuxinxi")); 
        return R.ok().put("data", chongwuxinxiService.selectListView(ew));
    }
    
    	 /** * 查询
     */
    @RequestMapping("/query")
    public R query(ChongwuxinxiEntity chongwuxinxi){
        EntityWrapper< ChongwuxinxiEntity> ew = new EntityWrapper< ChongwuxinxiEntity>();
     		ew.allEq(MPUtil.allEQMapPre( chongwuxinxi, "chongwuxinxi")); 
    		ChongwuxinxiView chongwuxinxiView =  chongwuxinxiService.selectView(ew);
    		return R.ok("查询宠物信息成功").put("data", chongwuxinxiView);
    }
    	
    /** * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        ChongwuxinxiEntity chongwuxinxi = chongwuxinxiService.selectById(id);
    		chongwuxinxi.setClicknum(chongwuxinxi.getClicknum()+1);
    		chongwuxinxi.setClicktime(new Date());
    		chongwuxinxiService.updateById(chongwuxinxi);
        return R.ok().put("data", chongwuxinxi);
    }
    
    /** * 前端详情
     */
    	@IgnoreAuth
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        ChongwuxinxiEntity chongwuxinxi = chongwuxinxiService.selectById(id);
    		chongwuxinxi.setClicknum(chongwuxinxi.getClicknum()+1);
    		chongwuxinxi.setClicktime(new Date());
    		chongwuxinxiService.updateById(chongwuxinxi);
        return R.ok().put("data", chongwuxinxi);
    }
    
    
    
    
    /** * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){
    	chongwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(chongwuxinxi);
    
        chongwuxinxiService.insert(chongwuxinxi);
        return R.ok();
    }
    
    /** * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){
    	chongwuxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(chongwuxinxi);
    
        chongwuxinxiService.insert(chongwuxinxi);
        return R.ok();
    }
    
    /** * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(chongwuxinxi);
        chongwuxinxiService.updateById(chongwuxinxi);//全部更新
        return R.ok();
    }
    
    
    /** * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        chongwuxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /** * 提醒接口
     */
    	@RequestMapping("/remind/{columnName}/{type}")
    	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
    						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    		map.put("column", columnName);
    		map.put("type", type);
    		
    		if(type.equals("2")) {
    			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    			Calendar c = Calendar.getInstance();
    			Date remindStartDate = null;
    			Date remindEndDate = null;
    			if(map.get("remindstart")!=null) {
    				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    				c.setTime(new Date()); 
    				c.add(Calendar.DAY_OF_MONTH,remindStart);
    				remindStartDate = c.getTime();
    				map.put("remindstart", sdf.format(remindStartDate));
    			}
    			if(map.get("remindend")!=null) {
    				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    				c.setTime(new Date());
    				c.add(Calendar.DAY_OF_MONTH,remindEnd);
    				remindEndDate = c.getTime();
    				map.put("remindend", sdf.format(remindEndDate));
    			}
    		}
    		
    		Wrapper<ChongwuxinxiEntity> wrapper = new EntityWrapper<ChongwuxinxiEntity>();
    		if(map.get("remindstart")!=null) {
    			wrapper.ge(columnName, map.get("remindstart"));
    		}
    		if(map.get("remindend")!=null) {
    			wrapper.le(columnName, map.get("remindend"));
    		}
    
    
    		int count = chongwuxinxiService.selectCount(wrapper);
    		return R.ok().put("count", count);
    	}
    	
    	/** * 前端智能排序
     */
    	@IgnoreAuth
    @RequestMapping("/autoSort")
    public R autoSort(@RequestParam Map<String, Object> params,ChongwuxinxiEntity chongwuxinxi, HttpServletRequest request,String pre){
        EntityWrapper<ChongwuxinxiEntity> ew = new EntityWrapper<ChongwuxinxiEntity>();
        Map<String, Object> newMap = new HashMap<String, Object>();
        Map<String, Object> param = new HashMap<String, Object>();
    		Iterator<Map.Entry<String, Object>> it = param.entrySet().iterator();
    		while (it.hasNext()) {
    			Map.Entry<String, Object> entry = it.next();
    			String key = entry.getKey();
    			String newKey = entry.getKey();
    			if (pre.endsWith(".")) {
    				newMap.put(pre + newKey, entry.getValue());
    			} else if (StringUtils.isEmpty(pre)) {
    				newMap.put(newKey, entry.getValue());
    			} else {
    				newMap.put(pre + "." + newKey, entry.getValue());
    			}
    		}
    		params.put("sort", "clicknum");
        
        params.put("order", "desc");
    		PageUtils page = chongwuxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, chongwuxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    
    }
GuahaoyuyueController.java
复制代码
    package com.controller;
    
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Calendar;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Date;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    
    import com.utils.ValidatorUtils;
    import org.apache.commons.lang3.StringUtils;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.format.annotation.DateTimeFormat;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;
    import org.springframework.web.bind.annotation.RestController;
    import com.baomidou.mybatisplus.mapper.EntityWrapper;
    import com.baomidou.mybatisplus.mapper.Wrapper;
    import com.annotation.IgnoreAuth;
    
    import com.entity.GuahaoyuyueEntity;
    import com.entity.view.GuahaoyuyueView;
    
    import com.service.GuahaoyuyueService;
    import com.service.TokenService;
    import com.utils.PageUtils;
    import com.utils.R;
    import com.utils.MD5Util;
    import com.utils.MPUtil;
    import com.utils.CommonUtil;
    
    
    /** * 挂号预约
     * 后端接口
     * @author 
     * @email 
     * @date 2021-04-15 20:04:19
     */
    @RestController
    @RequestMapping("/guahaoyuyue")
    public class GuahaoyuyueController {
    @Autowired
    private GuahaoyuyueService guahaoyuyueService;
    
    
    
    /** * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,GuahaoyuyueEntity guahaoyuyue, 
    		HttpServletRequest request){
    
        EntityWrapper<GuahaoyuyueEntity> ew = new EntityWrapper<GuahaoyuyueEntity>();
    		PageUtils page = guahaoyuyueService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, guahaoyuyue), params), params));
        return R.ok().put("data", page);
    }
    
    /** * 前端列表
     */
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,GuahaoyuyueEntity guahaoyuyue, HttpServletRequest request){
        EntityWrapper<GuahaoyuyueEntity> ew = new EntityWrapper<GuahaoyuyueEntity>();
    		PageUtils page = guahaoyuyueService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, guahaoyuyue), params), params));
        return R.ok().put("data", page);
    }
    
    	/** * 列表
     */
    @RequestMapping("/lists")
    public R list( GuahaoyuyueEntity guahaoyuyue){
       	EntityWrapper<GuahaoyuyueEntity> ew = new EntityWrapper<GuahaoyuyueEntity>();
      	ew.allEq(MPUtil.allEQMapPre( guahaoyuyue, "guahaoyuyue")); 
        return R.ok().put("data", guahaoyuyueService.selectListView(ew));
    }
    
    	 /** * 查询
     */
    @RequestMapping("/query")
    public R query(GuahaoyuyueEntity guahaoyuyue){
        EntityWrapper< GuahaoyuyueEntity> ew = new EntityWrapper< GuahaoyuyueEntity>();
     		ew.allEq(MPUtil.allEQMapPre( guahaoyuyue, "guahaoyuyue")); 
    		GuahaoyuyueView guahaoyuyueView =  guahaoyuyueService.selectView(ew);
    		return R.ok("查询挂号预约成功").put("data", guahaoyuyueView);
    }
    	
    /** * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        GuahaoyuyueEntity guahaoyuyue = guahaoyuyueService.selectById(id);
        return R.ok().put("data", guahaoyuyue);
    }
    
    /** * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        GuahaoyuyueEntity guahaoyuyue = guahaoyuyueService.selectById(id);
        return R.ok().put("data", guahaoyuyue);
    }
    
    
    
    
    /** * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody GuahaoyuyueEntity guahaoyuyue, HttpServletRequest request){
    	guahaoyuyue.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(guahaoyuyue);
    
        guahaoyuyueService.insert(guahaoyuyue);
        return R.ok();
    }
    
    /** * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody GuahaoyuyueEntity guahaoyuyue, HttpServletRequest request){
    	guahaoyuyue.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(guahaoyuyue);
    
        guahaoyuyueService.insert(guahaoyuyue);
        return R.ok();
    }
    
    /** * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody GuahaoyuyueEntity guahaoyuyue, HttpServletRequest request){
        //ValidatorUtils.validateEntity(guahaoyuyue);
        guahaoyuyueService.updateById(guahaoyuyue);//全部更新
        return R.ok();
    }
    
    
    /** * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        guahaoyuyueService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /** * 提醒接口
     */
    	@RequestMapping("/remind/{columnName}/{type}")
    	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
    						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    		map.put("column", columnName);
    		map.put("type", type);
    		
    		if(type.equals("2")) {
    			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    			Calendar c = Calendar.getInstance();
    			Date remindStartDate = null;
    			Date remindEndDate = null;
    			if(map.get("remindstart")!=null) {
    				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    				c.setTime(new Date()); 
    				c.add(Calendar.DAY_OF_MONTH,remindStart);
    				remindStartDate = c.getTime();
    				map.put("remindstart", sdf.format(remindStartDate));
    			}
    			if(map.get("remindend")!=null) {
    				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    				c.setTime(new Date());
    				c.add(Calendar.DAY_OF_MONTH,remindEnd);
    				remindEndDate = c.getTime();
    				map.put("remindend", sdf.format(remindEndDate));
    			}
    		}
    		
    		Wrapper<GuahaoyuyueEntity> wrapper = new EntityWrapper<GuahaoyuyueEntity>();
    		if(map.get("remindstart")!=null) {
    			wrapper.ge(columnName, map.get("remindstart"));
    		}
    		if(map.get("remindend")!=null) {
    			wrapper.le(columnName, map.get("remindend"));
    		}
    
    
    		int count = guahaoyuyueService.selectCount(wrapper);
    		return R.ok().put("count", count);
    	}
    	
    
    
    }
YishengxinxiController.java
复制代码
    package com.controller;
    
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Arrays;
    import java.util.Calendar;
    import java.util.Map;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.Date;
    import java.util.List;
    import javax.servlet.http.HttpServletRequest;
    
    import com.utils.ValidatorUtils;
    import org.apache.commons.lang3.StringUtils;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.format.annotation.DateTimeFormat;
    import org.springframework.web.bind.annotation.PathVariable;
    import org.springframework.web.bind.annotation.RequestBody;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RequestParam;
    import org.springframework.web.bind.annotation.RestController;
    import com.baomidou.mybatisplus.mapper.EntityWrapper;
    import com.baomidou.mybatisplus.mapper.Wrapper;
    import com.annotation.IgnoreAuth;
    
    import com.entity.YishengxinxiEntity;
    import com.entity.view.YishengxinxiView;
    
    import com.service.YishengxinxiService;
    import com.service.TokenService;
    import com.utils.PageUtils;
    import com.utils.R;
    import com.utils.MD5Util;
    import com.utils.MPUtil;
    import com.utils.CommonUtil;
    
    
    /** * 医生信息
     * 后端接口
     * @author 
     * @email 
     * @date 2021-04-15 20:04:19
     */
    @RestController
    @RequestMapping("/yishengxinxi")
    public class YishengxinxiController {
    @Autowired
    private YishengxinxiService yishengxinxiService;
    
    
    
    /** * 后端列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,YishengxinxiEntity yishengxinxi, 
    		HttpServletRequest request){
    
        EntityWrapper<YishengxinxiEntity> ew = new EntityWrapper<YishengxinxiEntity>();
    		PageUtils page = yishengxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yishengxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    /** * 前端列表
     */
    	@IgnoreAuth
    @RequestMapping("/list")
    public R list(@RequestParam Map<String, Object> params,YishengxinxiEntity yishengxinxi, HttpServletRequest request){
        EntityWrapper<YishengxinxiEntity> ew = new EntityWrapper<YishengxinxiEntity>();
    		PageUtils page = yishengxinxiService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, yishengxinxi), params), params));
        return R.ok().put("data", page);
    }
    
    	/** * 列表
     */
    @RequestMapping("/lists")
    public R list( YishengxinxiEntity yishengxinxi){
       	EntityWrapper<YishengxinxiEntity> ew = new EntityWrapper<YishengxinxiEntity>();
      	ew.allEq(MPUtil.allEQMapPre( yishengxinxi, "yishengxinxi")); 
        return R.ok().put("data", yishengxinxiService.selectListView(ew));
    }
    
    	 /** * 查询
     */
    @RequestMapping("/query")
    public R query(YishengxinxiEntity yishengxinxi){
        EntityWrapper< YishengxinxiEntity> ew = new EntityWrapper< YishengxinxiEntity>();
     		ew.allEq(MPUtil.allEQMapPre( yishengxinxi, "yishengxinxi")); 
    		YishengxinxiView yishengxinxiView =  yishengxinxiService.selectView(ew);
    		return R.ok("查询医生信息成功").put("data", yishengxinxiView);
    }
    	
    /** * 后端详情
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") Long id){
        YishengxinxiEntity yishengxinxi = yishengxinxiService.selectById(id);
        return R.ok().put("data", yishengxinxi);
    }
    
    /** * 前端详情
     */
    @RequestMapping("/detail/{id}")
    public R detail(@PathVariable("id") Long id){
        YishengxinxiEntity yishengxinxi = yishengxinxiService.selectById(id);
        return R.ok().put("data", yishengxinxi);
    }
    
    
    
    
    /** * 后端保存
     */
    @RequestMapping("/save")
    public R save(@RequestBody YishengxinxiEntity yishengxinxi, HttpServletRequest request){
    	yishengxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yishengxinxi);
    
        yishengxinxiService.insert(yishengxinxi);
        return R.ok();
    }
    
    /** * 前端保存
     */
    @RequestMapping("/add")
    public R add(@RequestBody YishengxinxiEntity yishengxinxi, HttpServletRequest request){
    	yishengxinxi.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
    	//ValidatorUtils.validateEntity(yishengxinxi);
    
        yishengxinxiService.insert(yishengxinxi);
        return R.ok();
    }
    
    /** * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody YishengxinxiEntity yishengxinxi, HttpServletRequest request){
        //ValidatorUtils.validateEntity(yishengxinxi);
        yishengxinxiService.updateById(yishengxinxi);//全部更新
        return R.ok();
    }
    
    
    /** * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        yishengxinxiService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
    
    /** * 提醒接口
     */
    	@RequestMapping("/remind/{columnName}/{type}")
    	public R remindCount(@PathVariable("columnName") String columnName, HttpServletRequest request, 
    						 @PathVariable("type") String type,@RequestParam Map<String, Object> map) {
    		map.put("column", columnName);
    		map.put("type", type);
    		
    		if(type.equals("2")) {
    			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
    			Calendar c = Calendar.getInstance();
    			Date remindStartDate = null;
    			Date remindEndDate = null;
    			if(map.get("remindstart")!=null) {
    				Integer remindStart = Integer.parseInt(map.get("remindstart").toString());
    				c.setTime(new Date()); 
    				c.add(Calendar.DAY_OF_MONTH,remindStart);
    				remindStartDate = c.getTime();
    				map.put("remindstart", sdf.format(remindStartDate));
    			}
    			if(map.get("remindend")!=null) {
    				Integer remindEnd = Integer.parseInt(map.get("remindend").toString());
    				c.setTime(new Date());
    				c.add(Calendar.DAY_OF_MONTH,remindEnd);
    				remindEndDate = c.getTime();
    				map.put("remindend", sdf.format(remindEndDate));
    			}
    		}
    		
    		Wrapper<YishengxinxiEntity> wrapper = new EntityWrapper<YishengxinxiEntity>();
    		if(map.get("remindstart")!=null) {
    			wrapper.ge(columnName, map.get("remindstart"));
    		}
    		if(map.get("remindend")!=null) {
    			wrapper.le(columnName, map.get("remindend"));
    		}
    
    
    		int count = yishengxinxiService.selectCount(wrapper);
    		return R.ok().put("count", count);
    	}
    	
    
    
    }
register.vue
复制代码
    <template>
      <div>
    <div class="container">
      <div class="login-form" style="backgroundColor:rgba(255, 255, 255, 1);borderRadius:10px">
        <h1 class="h1" style="color:rgba(131, 138, 182, 1);fontSize:28px;">宠物医院管理系统注册</h1>
    		<el-form ref="rgsForm" class="rgs-form" :model="rgsForm" label-width="120px">
    			<!-- <div v-if="tableName=='yonghu'" class="input-group">
    			   <div class="label">用户名</div>
    			   <div class="input-container">
    			     <input v-model="ruleForm.yonghuming" class="input" type="text" placeholder="用户名">
    			   </div>
    			 </div> -->
    			<el-form-item label="用户名" class="input" v-if="tableName=='yonghu'">
    			  <el-input v-model="ruleForm.yonghuming" autocomplete="off" placeholder="用户名"  />
    			</el-form-item>
    			<!-- <div v-if="tableName=='yonghu'" class="input-group">
    			   <div class="label">密码</div>
    			   <div class="input-container">
    			     <input v-model="ruleForm.mima" class="input" type="text" placeholder="密码">
    			   </div>
    			 </div> -->
    			<el-form-item label="密码" class="input" v-if="tableName=='yonghu'">
    			  <el-input v-model="ruleForm.mima" autocomplete="off" placeholder="密码" type="password"#elsetype="text" />
    			</el-form-item>
    			<!-- <div v-if="tableName=='yonghu'" class="input-group">
    			   <div class="label">姓名</div>
    			   <div class="input-container">
    			     <input v-model="ruleForm.xingming" class="input" type="text" placeholder="姓名">
    			   </div>
    			 </div> -->
    			<el-form-item label="姓名" class="input" v-if="tableName=='yonghu'">
    			  <el-input v-model="ruleForm.xingming" autocomplete="off" placeholder="姓名"  />
    			</el-form-item>
    			<!-- <div v-if="tableName=='yonghu'" class="input-group">
    			   <div class="label">年龄</div>
    			   <div class="input-container">
    			     <input v-model="ruleForm.nianling" class="input" type="text" placeholder="年龄">
    			   </div>
    			 </div> -->
    			<el-form-item label="年龄" class="input" v-if="tableName=='yonghu'">
    			  <el-input v-model="ruleForm.nianling" autocomplete="off" placeholder="年龄"  />
    			</el-form-item>
    			<!-- <div v-if="tableName=='yonghu'" class="input-group">
    			   <div class="label">手机</div>
    			   <div class="input-container">
    			     <input v-model="ruleForm.shouji" class="input" type="text" placeholder="手机">
    			   </div>
    			 </div> -->
    			<el-form-item label="手机" class="input" v-if="tableName=='yonghu'">
    			  <el-input v-model="ruleForm.shouji" autocomplete="off" placeholder="手机"  />
    			</el-form-item>
    			<!-- <div v-if="tableName=='yonghu'" class="input-group">
    			   <div class="label">邮箱</div>
    			   <div class="input-container">
    			     <input v-model="ruleForm.youxiang" class="input" type="text" placeholder="邮箱">
    			   </div>
    			 </div> -->
    			<el-form-item label="邮箱" class="input" v-if="tableName=='yonghu'">
    			  <el-input v-model="ruleForm.youxiang" autocomplete="off" placeholder="邮箱"  />
    			</el-form-item>
    			<div style="display: flex;flex-wrap: wrap;width: 100%;justify-content: center;">
    				<el-button class="btn" type="primary" @click="login()">注册</el-button>
    				<el-button class="btn close" type="primary" @click="close()">取消</el-button>
    			</div>
    		</el-form>
      </div>
      <!-- <div class="nk-navigation">
        <a href="#">
          <div @click="login()">注册</div>
        </a>
      </div> -->
    </div>
      </div>
    </template>
    <script>
    export default {
      data() {
    return {
      ruleForm: {
      },
      tableName:"",
      rules: {}
    };
      },
      mounted(){
    let table = this.$storage.get("loginTable");
    this.tableName = table;
      },
      methods: {
    // 获取uuid
    getUUID () {
      return new Date().getTime();
    },
    close(){
    	this.$router.push({ path: "/login" });
    },
    // 注册
    login() {
      if((!this.ruleForm.yonghuming) && `yonghu` == this.tableName){
        this.$message.error(`用户名不能为空`);
        return
      }
      if((!this.ruleForm.mima) && `yonghu` == this.tableName){
        this.$message.error(`密码不能为空`);
        return
      }
      if((!this.ruleForm.xingming) && `yonghu` == this.tableName){
        this.$message.error(`姓名不能为空`);
        return
      }
      if(`yonghu` == this.tableName && this.ruleForm.nianling&&(!this.$validate.isIntNumer(this.ruleForm.nianling))){
        this.$message.error(`年龄应输入整数`);
        return
      }
      if(`yonghu` == this.tableName && this.ruleForm.shouji&&(!this.$validate.isMobile(this.ruleForm.shouji))){
        this.$message.error(`手机应输入手机格式`);
        return
      }
      if(`yonghu` == this.tableName && this.ruleForm.youxiang&&(!this.$validate.isEmail(this.ruleForm.youxiang))){
        this.$message.error(`邮箱应输入邮件格式`);
        return
      }
      this.$http({
        url: `${this.tableName}/register`,
        method: "post",
        data:this.ruleForm
      }).then(({ data }) => {
        if (data && data.code === 0) {
          this.$message({
            message: "注册成功",
            type: "success",
            duration: 1500,
            onClose: () => {
              this.$router.replace({ path: "/login" });
            }
          });
        } else {
          this.$message.error(data.msg);
        }
      });
    }
      }
    };
    </script>
    <style lang="scss" scoped>
    	.el-radio__input.is-checked .el-radio__inner {
    		border-color: #00c292;
    		background: #00c292;
    	}
    
    	.el-radio__input.is-checked .el-radio__inner {
    		border-color: #00c292;
    		background: #00c292;
    	}
    
    	.el-radio__input.is-checked .el-radio__inner {
    		border-color: #00c292;
    		background: #00c292;
    	}
    
    	.el-radio__input.is-checked+.el-radio__label {
    		color: #00c292;
    	}
    
    	.el-radio__input.is-checked+.el-radio__label {
    		color: #00c292;
    	}
    
    	.el-radio__input.is-checked+.el-radio__label {
    		color: #00c292;
    	}
    
    	.h1 {
    		margin-top: 10px;
    	}
    
    	body {
    		padding: 0;
    		margin: 0;
    	}
    
    	// .container {
     //    min-height: 100vh;
     //    text-align: center;
     //    // background-color: #00c292;
     //    padding-top: 20vh;
     //    background-image: url(../assets/img/bg.jpg);
     //    background-size: 100% 100%;
     //    opacity: 0.9;
     //  }
    
    	// .login-form:before {
    	// 	vertical-align: middle;
    	// 	display: inline-block;
    	// }
    
    	// .login-form {
    	// 	max-width: 500px;
    	// 	padding: 20px 0;
    	// 	width: 80%;
    	// 	position: relative;
    	// 	margin: 0 auto;
    
    	// 	.label {
    	// 		min-width: 60px;
    	// 	}
    
    	// 	.input-group {
    	// 		max-width: 500px;
    	// 		padding: 20px 0;
    	// 		width: 80%;
    	// 		position: relative;
    	// 		margin: 0 auto;
    	// 		display: flex;
    	// 		align-items: center;
    
    	// 		.input-container {
    	// 			display: inline-block;
    	// 			width: 100%;
    	// 			text-align: left;
    	// 			margin-left: 10px;
    	// 		}
    
    	// 		.icon {
    	// 			width: 30px;
    	// 			height: 30px;
    	// 		}
    
    	// 		.input {
    	// 			position: relative;
    	// 			z-index: 2;
    	// 			float: left;
    	// 			width: 100%;
    	// 			margin-bottom: 0;
    	// 			box-shadow: none;
    	// 			border-top: 0px solid #ccc;
    	// 			border-left: 0px solid #ccc;
    	// 			border-right: 0px solid #ccc;
    	// 			border-bottom: 1px solid #ccc;
    	// 			padding: 0px;
    	// 			resize: none;
    	// 			border-radius: 0px;
    	// 			display: block;
    	// 			width: 100%;
    	// 			height: 34px;
    	// 			padding: 6px 12px;
    	// 			font-size: 14px;
    	// 			line-height: 1.42857143;
    	// 			color: #555;
    	// 			background-color: #fff;
    	// 		}
    
    	// 	}
    	// }
    
    	.nk-navigation {
    		margin-top: 15px;
    
    		a {
    			display: inline-block;
    			color: #fff;
    			background: rgba(255, 255, 255, .2);
    			width: 100px;
    			height: 50px;
    			border-radius: 30px;
    			text-align: center;
    			display: flex;
    			align-items: center;
    			margin: 0 auto;
    			justify-content: center;
    			padding: 0 20px;
    		}
    
    		.icon {
    			margin-left: 10px;
    			width: 30px;
    			height: 30px;
    		}
    	}
    
    	.register-container {
    		margin-top: 10px;
    
    		a {
    			display: inline-block;
    			color: #fff;
    			max-width: 500px;
    			height: 50px;
    			border-radius: 30px;
    			text-align: center;
    			display: flex;
    			align-items: center;
    			margin: 0 auto;
    			justify-content: center;
    			padding: 0 20px;
    
    			div {
    				margin-left: 10px;
    			}
    		}
    	}
    	
    	.container {
    		background-image: url("http://codegen.caihongy.cn/20210105/bf5686918faa4f68a9b7634e35a058d7.jpg");
    		height: 100vh;
    		background-position: center center;
    		background-size: cover;
    		background-repeat: no-repeat;
    	
    		.login-form {
    			right: 50%;
    			top: 50%;
    			height: auto;
    			transform: translate3d(50%, -50%, 0);
    			border-radius: 10px;
    			background-color: rgba(255,255,255,.5);
    			width: 420px;
    			padding: 30px 30px 40px 30px;
    			font-size: 14px;
    			font-weight: 500;
    			
    			.h1 {
    				margin: 0;
    				text-align: center;
    				line-height: 54px;
    			    font-size: 24px;
    			    color: #000;
    			}
    				
    			.rgs-form {
    				display: flex;
    				flex-direction: column;
    				justify-content: center;
    				align-items: center;
    				
    				.input {
    					width: 100%;
    					
    					& /deep/ .el-form-item__label {
    						line-height: 38px;
    						color: rgba(131, 138, 182, 1);
    						font-size: #606266;
    					}
    					
    					& /deep/ .el-input__inner {
    						height: 38px;
    						color: rgba(131, 138, 182, 1);
    						font-size: 14px;
    						border-width: 1px;
    						border-style: solid;
    						border-color: rgba(236, 236, 255, 1);
    						border-radius: 4px;
    						background-color: #fff;
    					}
    				}
    				
    				.btn {
    					margin: 0 10px;
    					width: 88px;
    					height: 44px;
    					color: #fff;
    					font-size: 14px;
    					border-width: 0px;
    					border-style: solid;
    					border-color: #409EFF;
    					border-radius: 4px;
    					background-color: rgba(84, 88, 179, 1);
    				}
    
    				.close {
    					margin: 0 10px;
    					width: 88px;
    					height: 44px;
    					color: #409EFF;
    					font-size: 14px;
    					border-width: 1px;
    					border-style: solid;
    					border-color: #409EFF;
    					border-radius: 4px;
    					background-color: #FFF;
    				}
    
    			}
    		}
    	}
    </style>

声明

该平台能够广泛应用于学术研究与教学实践中。

该平台涵盖个人学习、系统开发设计以及产品设计等多个方面。

该平台仅作为学术参考材料。

该平台以满足读者深入理解相关技术与研究方法为目标。

全部评论 (0)

还没有任何评论哟~