修复注册姓名校验失效问题,修复文件上传无法回调问题
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.fjy</groupId>
|
||||
<artifactId>spring</artifactId>
|
||||
<version>V2.9.5</version>
|
||||
<version>V2.9.6</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>spring</name>
|
||||
|
||||
@@ -74,7 +74,7 @@ public class RegisterController {
|
||||
public boolean doCheckStudent(@RequestParam(value = "studentno") String studentno,
|
||||
@RequestParam(value = "realname") String realname){
|
||||
TbStudentlist studentlist = studentService.findByColstudentnoAndColrealname(studentno,realname);
|
||||
if (studentlist!=null&&studentlist.getRegistered().equals(RegisteredEnum.REGISTERED.getCode()) ) {
|
||||
if (studentlist==null||studentlist.getRegistered().equals(RegisteredEnum.REGISTERED.getCode()) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -297,10 +297,21 @@ var Main = {
|
||||
handleClick(row) {
|
||||
console.log(row.colfileid);
|
||||
},
|
||||
uploadSuccess (response, file, fileList) {
|
||||
let that = this;
|
||||
if (file.status==="success"){
|
||||
that.openNotiSuccess("成功", file.name+"上传成功!");
|
||||
}else{
|
||||
that.openNotiError("失败", file.name+"上传失败!");
|
||||
}
|
||||
/* console.log('response', response);
|
||||
console.log('file',file,fileList);
|
||||
console.log('fileList',fileList);
|
||||
console.log("信息"+file.status+"|"+file.name)*/
|
||||
},
|
||||
submitUpload() {
|
||||
let that = this;
|
||||
this.$refs.upload.submit();
|
||||
this.openNotiSuccess("成功", "文件上传成功!");
|
||||
setTimeout(function () {
|
||||
that.getFileList();
|
||||
}, 1000);
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
let datax = [
|
||||
{
|
||||
courseNo: 1,
|
||||
courseName: "信息安全T",
|
||||
courseTime: "2018-02-07 20:42:28.0",
|
||||
teacherusername: "FJY1",
|
||||
teacherrealname: "root1"
|
||||
}
|
||||
];
|
||||
var Main = {
|
||||
data() {
|
||||
return {
|
||||
@@ -12,10 +21,10 @@ var Main = {
|
||||
tableData3: [
|
||||
{
|
||||
courseNo: 1,
|
||||
courseName: "信息安全",
|
||||
courseTime: "2018-02-06 20:42:28.0",
|
||||
teacherusername: "FJY",
|
||||
teacherrealname: "root"
|
||||
courseName: "信息安全T",
|
||||
courseTime: "2018-02-07 20:42:28.0",
|
||||
teacherusername: "FJY1",
|
||||
teacherrealname: "root1"
|
||||
}
|
||||
],
|
||||
multipleSelection: [],
|
||||
@@ -33,6 +42,7 @@ var Main = {
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.tableData3 = response.data;
|
||||
datax=response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
|
||||
@@ -2,116 +2,121 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:th="http://www.thymeleaf.org">
|
||||
<body>
|
||||
<el-header th:fragment="header">
|
||||
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
||||
<el-menu-item index="1" @click="ClickToJump('home')">首页</el-menu-item>
|
||||
<el-menu-item index="2" @click="ClickToJump('home/user')">个人中心</el-menu-item>
|
||||
<el-menu-item index="3" @click="ClickToJump('home/about')">关于</el-menu-item>
|
||||
<el-menu-item index="4" @click="ClickToJump('home/feedback')">意见反馈</el-menu-item>
|
||||
<el-menu-item index="5"@click="ClickToJump('logout')">登出</el-menu-item>
|
||||
</el-menu>
|
||||
</el-header>
|
||||
<el-header th:fragment="header">
|
||||
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect">
|
||||
<el-menu-item index="1" @click="ClickToJump('home')">首页</el-menu-item>
|
||||
<el-menu-item index="2" @click="ClickToJump('home/user')">个人中心</el-menu-item>
|
||||
<el-menu-item index="3" @click="ClickToJump('home/about')">关于</el-menu-item>
|
||||
<el-menu-item index="4" @click="ClickToJump('home/feedback')">意见反馈</el-menu-item>
|
||||
<el-menu-item index="5" @click="ClickToJump('logout')">登出</el-menu-item>
|
||||
</el-menu>
|
||||
</el-header>
|
||||
|
||||
<el-aside width="200px" th:fragment="asider">
|
||||
<el-row class="tac">
|
||||
<el-col :span="24">
|
||||
<h5>默认颜色</h5>
|
||||
<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
|
||||
<el-submenu index="1">
|
||||
<template slot="title">
|
||||
<i class="el-icon-location"></i>
|
||||
<span>导航一</span>
|
||||
</template>
|
||||
<el-menu-item-group>
|
||||
<template slot="title">分组一</template>
|
||||
<el-menu-item index="1-1">选项1</el-menu-item>
|
||||
<el-menu-item index="1-2">选项2</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
<el-menu-item-group title="分组2">
|
||||
<el-menu-item index="1-3">选项3</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
<el-submenu index="1-4">
|
||||
<template slot="title">选项4</template>
|
||||
<el-menu-item index="1-4-1">选项1</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-submenu>
|
||||
<el-menu-item index="2">
|
||||
<i class="el-icon-menu"></i>
|
||||
<span slot="title">导航二</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="3">
|
||||
<i class="el-icon-setting"></i>
|
||||
<span slot="title">导航三</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-aside>
|
||||
|
||||
<el-card class="box-card" th:fragment="userbox">
|
||||
<div slot="header" class="clearfix">
|
||||
<!--下面两行报错正常-->
|
||||
<span th:text="${#httpServletRequest.getSession().getAttribute('USER_SESSION').colname}">用户名</span><br>
|
||||
<span th:text="${#httpServletRequest.getSession().getAttribute('USER_SESSION').colstudentno}"></span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<el-button type="text" @click="ClickToJump('home')">首页</el-button><br>
|
||||
<el-button type="text" @click="ClickToJump('home/user')">个人中心</el-button><br>
|
||||
<el-button type="text" @click="ClickToJump('home/about')">关于</el-button><br>
|
||||
<el-button type="text" @click="ClickToJump('home/feedback')">意见反馈</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card" th:fragment="adminbox">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>管理员</span><br>
|
||||
<span>管理员号</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<el-button type="text" @click="ClickToJump('home/admin')">后台主页</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/admin/managecourse')">课程管理</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/admin/homework')">作业管理</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/admin/manageuser')">用户管理</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card hidden-xs-only" th:fragment="timelimit">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>作业提交倒计时</span>
|
||||
<!--超时后仍为正数-->
|
||||
<!--<span style="color: red"> 功能未完成</span>-->
|
||||
</div>
|
||||
<div class="text item">
|
||||
<el-table :data="tableHomeworkData" style="width: 100%"
|
||||
:default-sort="{prop: 'time', order: 'descending'}">
|
||||
<el-table-column prop="coursename" label="科目" sortable width="180">
|
||||
</el-table-column>
|
||||
<el-table-column prop="time" label="倒计时" sortable>
|
||||
<template slot-scope="scope">
|
||||
{{limitTime(scope.row)}}
|
||||
<el-aside width="200px" th:fragment="asider">
|
||||
<el-row class="tac">
|
||||
<el-col :span="24">
|
||||
<h5>默认颜色</h5>
|
||||
<el-menu default-active="2" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
|
||||
<el-submenu index="1">
|
||||
<template slot="title">
|
||||
<i class="el-icon-location"></i>
|
||||
<span>导航一</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-menu-item-group>
|
||||
<template slot="title">分组一</template>
|
||||
<el-menu-item index="1-1">选项1</el-menu-item>
|
||||
<el-menu-item index="1-2">选项2</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
<el-menu-item-group title="分组2">
|
||||
<el-menu-item index="1-3">选项3</el-menu-item>
|
||||
</el-menu-item-group>
|
||||
<el-submenu index="1-4">
|
||||
<template slot="title">选项4</template>
|
||||
<el-menu-item index="1-4-1">选项1</el-menu-item>
|
||||
</el-submenu>
|
||||
</el-submenu>
|
||||
<el-menu-item index="2">
|
||||
<i class="el-icon-menu"></i>
|
||||
<span slot="title">导航二</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="3">
|
||||
<i class="el-icon-setting"></i>
|
||||
<span slot="title">导航三</span>
|
||||
</el-menu-item>
|
||||
</el-menu>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-aside>
|
||||
|
||||
<el-card class="box-card hidden-xs-only" th:fragment="notice">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>公告</span>
|
||||
</div>
|
||||
<div v-for="notice in NoticeList" class="text item">
|
||||
{{notice.noticeContent + notice.issueTime}}
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card class="box-card" th:fragment="userbox">
|
||||
<div slot="header" class="clearfix">
|
||||
<!--下面两行报错正常-->
|
||||
<span th:text="${#httpServletRequest.getSession().getAttribute('USER_SESSION').colname}">用户名</span><br>
|
||||
<span th:text="${#httpServletRequest.getSession().getAttribute('USER_SESSION').colstudentno}"></span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<el-button type="text" @click="ClickToJump('home')">首页</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/user')">个人中心</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/about')">关于</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/feedback')">意见反馈</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-footer th:fragment="footer">
|
||||
<div class="footer">
|
||||
Copyright © 2018 作业提交系统 All Rights Reserved|
|
||||
<a href="http://www.miitbeian.gov.cn/">粤ICP备18026008号</a> 粤ICP备18026008号-1
|
||||
</div>
|
||||
</el-footer>
|
||||
<el-card class="box-card" th:fragment="adminbox">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>管理员</span><br>
|
||||
<span>管理员号</span>
|
||||
</div>
|
||||
<div class="item">
|
||||
<el-button type="text" @click="ClickToJump('home/admin')">后台主页</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/admin/managecourse')">课程管理</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/admin/homework')">作业管理</el-button>
|
||||
<br>
|
||||
<el-button type="text" @click="ClickToJump('home/admin/manageuser')">用户管理</el-button>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card hidden-xs-only" th:fragment="timelimit">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>作业提交倒计时</span>
|
||||
<!--超时后仍为正数-->
|
||||
<!--<span style="color: red"> 功能未完成</span>-->
|
||||
</div>
|
||||
<div class="text item">
|
||||
<el-table :data="tableHomeworkData" style="width: 100%"
|
||||
:default-sort="{prop: 'time', order: 'descending'}">
|
||||
<el-table-column prop="coursename" label="科目" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column prop="workname" label="作业" sortable>
|
||||
</el-table-column>
|
||||
<el-table-column prop="time" label="倒计时" sortable>
|
||||
<template slot-scope="scope">
|
||||
{{limitTime(scope.row)}}
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card hidden-xs-only" th:fragment="notice">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>公告</span>
|
||||
</div>
|
||||
<div v-for="notice in NoticeList" class="text item">
|
||||
{{notice.noticeContent + notice.issueTime}}
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-footer th:fragment="footer">
|
||||
<div class="footer">
|
||||
Copyright © 2018 作业提交系统 All Rights Reserved|
|
||||
<a href="http://www.miitbeian.gov.cn/">粤ICP备18026008号</a> 粤ICP备18026008号-1
|
||||
</div>
|
||||
</el-footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -129,6 +129,8 @@
|
||||
<el-upload class="upload-demo" ref="upload"
|
||||
:action="uploadURL(props.row)"
|
||||
:on-preview="handlePreview(props.row)"
|
||||
:on-success="uploadSuccess"
|
||||
:on-error="uploadSuccess"
|
||||
:on-remove="handleRemove" :file-list="fileList"
|
||||
:auto-upload="false"
|
||||
v-show="isShow(props.row)"
|
||||
|
||||
@@ -35,7 +35,8 @@
|
||||
<el-form-item
|
||||
label="密码" prop="colpassword">
|
||||
<el-input type="password"
|
||||
v-model="ruleForm1.colpassword" auto-complete="off" name="colpassword"></el-input>
|
||||
v-model="ruleForm1.colpassword" auto-complete="off"
|
||||
name="colpassword"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary"
|
||||
@@ -60,8 +61,12 @@
|
||||
<el-form-item
|
||||
label="密码" prop="colpassword">
|
||||
<el-input type="password"
|
||||
v-model="ruleForm2.colpassword" auto-complete="off" name="colpassword"></el-input>
|
||||
<el-tooltip class="item" effect="dark" content="全站密码采用SHA加密算法,任何人都无法获取用户密码" placement="right">
|
||||
v-model="ruleForm2.colpassword" auto-complete="off"
|
||||
name="colpassword"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-tooltip class="item" effect="dark" content="全站密码采用SHA加密算法,任何人都无法获取用户密码"
|
||||
placement="right">
|
||||
<el-button type="text">密码安全性?</el-button>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
@@ -106,7 +111,8 @@
|
||||
prop="colname">
|
||||
<el-input
|
||||
v-model="ruleForm3.colname" name="colname"></el-input>
|
||||
<el-tooltip class="item" effect="dark" content="全站对问题的答案进行SHA加密算法,任何人均无法获取用户知晓用户的问题答案" placement="right">
|
||||
<el-tooltip class="item" effect="dark"
|
||||
content="全站对问题的答案进行SHA加密算法,任何人均无法获取用户知晓用户的问题答案" placement="right">
|
||||
<el-button type="text">问题和答案安全性?</el-button>
|
||||
</el-tooltip>
|
||||
</el-form-item>
|
||||
@@ -131,7 +137,8 @@
|
||||
<el-form-item
|
||||
label="输入新密码" prop="colpassword">
|
||||
<el-input type="password"
|
||||
v-model="ruleForm3.colpassword" auto-complete="off" name="colpassword"></el-input>
|
||||
v-model="ruleForm3.colpassword" auto-complete="off"
|
||||
name="colpassword"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="checkPass">
|
||||
<el-input
|
||||
@@ -152,7 +159,7 @@
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-footer th:include="dist/thymeleaf/layout :: footer"></el-footer>
|
||||
<el-footer th:include="dist/thymeleaf/layout :: footer"></el-footer>
|
||||
</el-row>
|
||||
</div>
|
||||
<script th:src="@{js/loginstyle.js}"></script>
|
||||
|
||||
@@ -10,6 +10,8 @@ import org.springframework.test.web.servlet.MockMvc;
|
||||
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
|
||||
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
|
||||
@@ -28,6 +30,7 @@ public class LoginControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Transactional
|
||||
public void doLogin() throws Exception {
|
||||
//测试正常登录
|
||||
mvc.perform(MockMvcRequestBuilders.post("/login/dologin").param("colname", "root").param("colpassword", "admin"))
|
||||
|
||||
@@ -26,7 +26,7 @@ public class RegisterControllerTest {
|
||||
@Test
|
||||
@Transactional
|
||||
public void doRegister()throws Exception {
|
||||
//测试正常注册,abc每次调试必须改,因为唯一约束
|
||||
// 测试正常注册
|
||||
mvc.perform(MockMvcRequestBuilders.post("/register/doregister")
|
||||
.param("colname", "abc")
|
||||
.param("colpassword", "123456")
|
||||
@@ -38,11 +38,11 @@ public class RegisterControllerTest {
|
||||
|
||||
@Test
|
||||
public void doCheckStudentNo()throws Exception {
|
||||
//测试非法学号检查
|
||||
// 测试非法学号检查
|
||||
mvc.perform(MockMvcRequestBuilders.get("/CheckStudentNo")
|
||||
.param("studentno","0003"))
|
||||
.andExpect(MockMvcResultMatchers.content().string("false"));
|
||||
//测试合法学号检查
|
||||
// 测试合法学号检查
|
||||
mvc.perform(MockMvcRequestBuilders.get("/CheckStudentNo")
|
||||
.param("studentno","15251101238"))
|
||||
.andExpect(MockMvcResultMatchers.content().string("true"));
|
||||
@@ -50,25 +50,25 @@ public class RegisterControllerTest {
|
||||
|
||||
@Test
|
||||
public void doCheckStudent()throws Exception {
|
||||
//测试学号与姓名不匹配
|
||||
// 测试学号与姓名不匹配
|
||||
mvc.perform(MockMvcRequestBuilders.get("/CheckStudent")
|
||||
.param("studentno","15251101238")
|
||||
.param("realname","符嘉"))
|
||||
.andExpect(MockMvcResultMatchers.content().string("true"));
|
||||
//测试学号与姓名匹配
|
||||
mvc.perform(MockMvcRequestBuilders.get("/CheckStudent")
|
||||
.param("studentno","15251101238")
|
||||
.param("realname","符嘉阳"))
|
||||
.param("studentno","15251101243")
|
||||
.param("realname","杨诗"))
|
||||
.andExpect(MockMvcResultMatchers.content().string("false"));
|
||||
// 测试学号与姓名匹配
|
||||
mvc.perform(MockMvcRequestBuilders.get("/CheckStudent")
|
||||
.param("studentno","15251101243")
|
||||
.param("realname","杨诗敏"))
|
||||
.andExpect(MockMvcResultMatchers.content().string("true"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void doUserName()throws Exception {
|
||||
//测试用户名已存在
|
||||
// 测试用户名已存在
|
||||
mvc.perform(MockMvcRequestBuilders.get("/CheckUserName")
|
||||
.param("name","root"))
|
||||
.andExpect(MockMvcResultMatchers.content().string("false"));
|
||||
//测试用户名不存在
|
||||
// 测试用户名不存在
|
||||
mvc.perform(MockMvcRequestBuilders.get("/CheckUserName")
|
||||
.param("name","root1"))
|
||||
.andExpect(MockMvcResultMatchers.content().string("true"));
|
||||
|
||||
Reference in New Issue
Block a user