一、系统简介
本项目采用idea工具开发,jsp+spring+spring-mvc+mybatis+jquery技术编写,数据库采用的是mysql,navicat开发工具。
系统一共分为2个角色分别是:管理员,学生
二、模块简介
管理员
1、登录
2、学生管理
3、公告管理
4、分类管理
5、物品管理
6、失物信息管理
7、订单管理
8、评论管理
9、个人信息管理
10、统计管理
学生
1、登录注册
2、浏览网站
3、查看二手物品
4、查看详情
5、加入购物车
6、查看失物信息
7、查看公告
8、下单商品
9、个人信息管理
10、发布物品
11、发布失物信息
12、评论商品
项目简介
难度等级:✩✩✩
用户类型:2角色(管理员,学生)
设计模式:MVC
项目架构:B/S架构
开发语言:Java语言
前端技术:HTML、CSS、JS、JQuery等
后端技术:JSP、ssm框架
运行环境:Windows7或10、JDK1.8
运行工具:本系统采用idea开发,仅支持idea运行,不支持MyEclipse和eclipse运行,因为三者的骨架不一样,强行导入打开运行可能会导致出现未知的错误。(如若想用eclipse运行,需要转换!!!!)
数 据 库:MySQL5.5/5.7/8.0版本
运行服务器:Tomcat7.0/8.0/8.5/9.0等版本
是否基于Maven环境:否
是否采用框架:是
数据库表数量:10张表
JSP页面数量:30多张
是否有分页:有分页
相关截图
相关代码
登录
登录
<link rel="icon" href="/resource/static/favicon.ico">
<link rel="stylesheet" href="/resource/static/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/resource/static/admin/css/login.css">
<script src="/resource/static/js/vue.min.js">
<script src="/resource/static/js/jquery-3.3.1.min.js">
<script src="/resource/static/bootstrap/js/bootstrap.bundle.js">
body{
background-image:url(/resource/back.jpeg) ;/*插入的背景图片的url
background-attachment: fixed;/*背景图片不会固定不会因页面滚动而重复*/
background-repeat: no-repeat;/*使图片不管任何大小都不会重复*/
background-size: 100%;/*改变背景图的长和宽*/
}
校园二手物品交易平台登录
$("#login").click(function(){
var username = $("#username").val();
var password = $("#password").val();
if(username == null || username == ""){
alert("请填写用户名");
return false;
}if(password == null || password == ""){
alert("请填写密码");
return false;
}
//执行添加的操作ajax
$.ajax({
cache:true,
type:"post",
url:"login",
data:$("#saveForm").serialize(),
async:false,
success:function(e){
if(e == 'ok'){
alert("登录成功");
window.parent.location.href="toMain";
}else if(e == 'toIndex'){
alert("登录成功");
window.parent.location.href="toIndex";
}else{
alert("登录失败,账号或密码错误");
}
}
})
});
/**
* 登录
* @param username
* @param request
* @param password
* @param session
* @param response
* @param mv
* @return
* @throws ServletException
* @throws IOException
*/
@RequestMapping("/login")
@ResponseBody
public String login(@RequestParam("username")String username,
HttpServletRequest request, @RequestParam("password")String password,
HttpSession session, HttpServletResponse response, ModelAndView mv) throws ServletException, IOException {
session.removeAttribute("admin");
session.removeAttribute("student");
String type=request.getParameter("type").toString();
request.getSession().setAttribute("type", type);
String message = "error";
if(type != null && type.equals("1")){
Admin admin1 = service.selectAdmin(username,password);
if(admin1 != null){
request.getSession().setAttribute("admin", admin1);
message = "ok";
}
}else if(type != null && type.equals("2")){
Student te = service.selectStudent(username,password);
if(te != null){
request.getSession().setAttribute("student", te);
message = "toIndex";
}
}
return message;
}