实现对密保问题的设置和加密存储
This commit is contained in:
@@ -4,18 +4,23 @@ import com.fjy.spring.domain.*;
|
|||||||
import com.fjy.spring.enums.ResultEnum;
|
import com.fjy.spring.enums.ResultEnum;
|
||||||
import com.fjy.spring.exception.UserException;
|
import com.fjy.spring.exception.UserException;
|
||||||
import com.fjy.spring.service.*;
|
import com.fjy.spring.service.*;
|
||||||
|
import com.fjy.spring.untils.CodingUtil;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.math.BigInteger;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import static com.fjy.spring.constant.GlobalConstant.USER_SESSION_KEY;
|
import static com.fjy.spring.constant.GlobalConstant.USER_SESSION_KEY;
|
||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
|
@Slf4j
|
||||||
public class DataController {
|
public class DataController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
@@ -43,7 +48,7 @@ public class DataController {
|
|||||||
private VUserfileService vUserfileService;
|
private VUserfileService vUserfileService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
HttpServletRequest httpServletRequest;
|
private HttpServletRequest httpServletRequest;
|
||||||
|
|
||||||
@GetMapping("/home/findAllHomework")
|
@GetMapping("/home/findAllHomework")
|
||||||
public List<VWorkDetail> findAllHomework(){
|
public List<VWorkDetail> findAllHomework(){
|
||||||
@@ -51,8 +56,7 @@ public class DataController {
|
|||||||
if (homeworks!=null){
|
if (homeworks!=null){
|
||||||
return homeworks;
|
return homeworks;
|
||||||
}
|
}
|
||||||
new UserException(ResultEnum.EMPTY_DATA);
|
throw new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/home/findvlog")
|
@GetMapping("/home/findvlog")
|
||||||
@@ -61,8 +65,7 @@ public class DataController {
|
|||||||
if (vlogs!=null){
|
if (vlogs!=null){
|
||||||
return vlogs;
|
return vlogs;
|
||||||
}
|
}
|
||||||
new UserException(ResultEnum.EMPTY_DATA);
|
throw new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/home/findvfeedback")
|
@GetMapping("/home/findvfeedback")
|
||||||
@@ -71,8 +74,7 @@ public class DataController {
|
|||||||
if (feedBacks!=null){
|
if (feedBacks!=null){
|
||||||
return feedBacks;
|
return feedBacks;
|
||||||
}
|
}
|
||||||
new UserException(ResultEnum.EMPTY_DATA);
|
throw new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/home/findvcourse")
|
@GetMapping("/home/findvcourse")
|
||||||
@@ -81,8 +83,7 @@ public class DataController {
|
|||||||
if (vCourses!=null){
|
if (vCourses!=null){
|
||||||
return vCourses;
|
return vCourses;
|
||||||
}
|
}
|
||||||
new UserException(ResultEnum.EMPTY_DATA);
|
throw new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/home/findalluser")
|
@GetMapping("/home/findalluser")
|
||||||
@@ -91,8 +92,7 @@ public class DataController {
|
|||||||
if (users!=null){
|
if (users!=null){
|
||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
new UserException(ResultEnum.EMPTY_DATA);
|
throw new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/home/findallvhomework")
|
@GetMapping("/home/findallvhomework")
|
||||||
@@ -101,8 +101,7 @@ public class DataController {
|
|||||||
if (vHomeworks!=null){
|
if (vHomeworks!=null){
|
||||||
return vHomeworks;
|
return vHomeworks;
|
||||||
}
|
}
|
||||||
new UserException(ResultEnum.EMPTY_DATA);
|
throw new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/home/findStudentInCourseFile")
|
@GetMapping("/home/findStudentInCourseFile")
|
||||||
@@ -112,8 +111,7 @@ public class DataController {
|
|||||||
if (files!=null){
|
if (files!=null){
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
new UserException(ResultEnum.EMPTY_DATA);
|
throw new UserException(ResultEnum.EMPTY_DATA);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/home/userinfo")
|
@GetMapping("/home/userinfo")
|
||||||
@@ -121,4 +119,17 @@ public class DataController {
|
|||||||
TbUser user= (TbUser)httpServletRequest.getSession().getAttribute(USER_SESSION_KEY);
|
TbUser user= (TbUser)httpServletRequest.getSession().getAttribute(USER_SESSION_KEY);
|
||||||
return userService.findUserInfo(user.getColuserid());
|
return userService.findUserInfo(user.getColuserid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 存储密保问题
|
||||||
|
* @param userque
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@PostMapping("/home/adduserque")
|
||||||
|
public boolean adduserque(TbUserque userque)throws Exception{
|
||||||
|
log.info(userque.toString());
|
||||||
|
//对密保问题加密存储
|
||||||
|
userque.setAnswer(new BigInteger(CodingUtil.encryptSHA(userque.getAnswer().getBytes())).toString(32));
|
||||||
|
return userService.addUserQue(userque);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
23
src/main/java/com/fjy/spring/domain/TbUserque.java
Normal file
23
src/main/java/com/fjy/spring/domain/TbUserque.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
package com.fjy.spring.domain;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Data
|
||||||
|
public class TbUserque {
|
||||||
|
|
||||||
|
@Id
|
||||||
|
@Column(name = "coluserid")
|
||||||
|
private Integer userid;
|
||||||
|
|
||||||
|
@Column(name = "colquestion")
|
||||||
|
private String question;
|
||||||
|
|
||||||
|
@Column(name = "colanswer")
|
||||||
|
private String answer;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
package com.fjy.spring.repository;
|
||||||
|
|
||||||
|
import com.fjy.spring.domain.TbUserque;
|
||||||
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
|
|
||||||
|
|
||||||
|
public interface TbUserqueRepository extends JpaRepository<TbUserque,Integer> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package com.fjy.spring.service;
|
package com.fjy.spring.service;
|
||||||
|
|
||||||
import com.fjy.spring.domain.TbUser;
|
import com.fjy.spring.domain.TbUser;
|
||||||
|
import com.fjy.spring.domain.TbUserque;
|
||||||
import com.fjy.spring.domain.VUserinfo;
|
import com.fjy.spring.domain.VUserinfo;
|
||||||
import com.fjy.spring.enums.ResultEnum;
|
import com.fjy.spring.enums.ResultEnum;
|
||||||
import com.fjy.spring.exception.UserException;
|
import com.fjy.spring.exception.UserException;
|
||||||
import com.fjy.spring.repository.TbUserRepository;
|
import com.fjy.spring.repository.TbUserRepository;
|
||||||
|
import com.fjy.spring.repository.TbUserqueRepository;
|
||||||
import com.fjy.spring.repository.VUserinfoRepository;
|
import com.fjy.spring.repository.VUserinfoRepository;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -19,6 +21,9 @@ public class UserService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TbUserRepository tbUserRepository;
|
private TbUserRepository tbUserRepository;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TbUserqueRepository userqueRepository;
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private VUserinfoRepository vUserinfoRepository;
|
private VUserinfoRepository vUserinfoRepository;
|
||||||
|
|
||||||
@@ -66,4 +71,11 @@ public class UserService {
|
|||||||
return tbUserRepository.findByColname(name);
|
return tbUserRepository.findByColname(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean addUserQue(TbUserque userque){
|
||||||
|
TbUserque tbUserque = userqueRepository.save(userque);
|
||||||
|
if (tbUserque!=null)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,6 +94,66 @@ var Main = {
|
|||||||
fileList: [],
|
fileList: [],
|
||||||
DownloadList: [],
|
DownloadList: [],
|
||||||
VersionList:[
|
VersionList:[
|
||||||
|
{
|
||||||
|
date:'2018-02-24',
|
||||||
|
content:'实现对重复文件自动重命名',
|
||||||
|
version:'V1.11',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-24',
|
||||||
|
content:'实现对文件是否重命名的控制,目前设定为管理员上传的文件不会重命名,完善日志输出存储',
|
||||||
|
version:'V1.10',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-24',
|
||||||
|
content:'添加运行日志处理,频率为每天对error和info级别的日志进行文件保存,实现判断注册用户名是否已存在',
|
||||||
|
version:'V1.9.1',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-24',
|
||||||
|
content:'实现前端对学号和用户名的异步判断,核心技术为axios',
|
||||||
|
version:'V1.9',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-24',
|
||||||
|
content:'修复注册表单输入正确不会显示反馈图标的问题',
|
||||||
|
version:'V1.8.2',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-24',
|
||||||
|
content:'修复文件批量下载的错误,为压缩文件进行统一管理,批量下载不支持多线程',
|
||||||
|
version:'V1.8.1',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-24',
|
||||||
|
content:'实现文件批量下载',
|
||||||
|
version:'V1.8',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-23',
|
||||||
|
content:'实现对未交作业人员的查询和展示',
|
||||||
|
version:'V1.7',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-23',
|
||||||
|
content:'去除js对绝对地址的依赖,为日志添加排序选项',
|
||||||
|
version:'V1.6.1',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date:'2018-02-23',
|
||||||
|
content:'实现用户仅能查看自己提交的文件',
|
||||||
|
version:'V1.6',
|
||||||
|
user:'F嘉阳'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
date:'2018-02-23',
|
date:'2018-02-23',
|
||||||
content:'修复用户信息修改页面数据绑定方式,改为使用axios进行数据获取和绑定',
|
content:'修复用户信息修改页面数据绑定方式,改为使用axios进行数据获取和绑定',
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
var dt = new Date();
|
var dt = new Date();
|
||||||
|
let th = this;
|
||||||
var month = dt.getMonth()+1;
|
var month = dt.getMonth()+1;
|
||||||
var day = dt.getDate();
|
var day = dt.getDate();
|
||||||
var year = dt.getFullYear();
|
var year = dt.getFullYear();
|
||||||
@@ -14,6 +15,20 @@ function DateDiff(sDate1, sDate2){ //sDate1和sDate2是2002-12-18格式
|
|||||||
}
|
}
|
||||||
var Main = {
|
var Main = {
|
||||||
data() {
|
data() {
|
||||||
|
var checkQuestion = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return callback(new Error('问题不能为空'));
|
||||||
|
}else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var checkAnswer = (rule, value, callback) => {
|
||||||
|
if (!value) {
|
||||||
|
return callback(new Error('答案不能为空'));
|
||||||
|
}else {
|
||||||
|
callback()
|
||||||
|
}
|
||||||
|
};
|
||||||
var checkName = (rule, value, callback) => {
|
var checkName = (rule, value, callback) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return callback(new Error('用户名不能为空'));
|
return callback(new Error('用户名不能为空'));
|
||||||
@@ -65,6 +80,19 @@ var Main = {
|
|||||||
colpassword: '',
|
colpassword: '',
|
||||||
checkPass: '',
|
checkPass: '',
|
||||||
},
|
},
|
||||||
|
ruleForm3: {
|
||||||
|
coluserid:'',
|
||||||
|
question: '',
|
||||||
|
answer: ''
|
||||||
|
},
|
||||||
|
rules3: {
|
||||||
|
question: [
|
||||||
|
{required: true,validator: checkQuestion, trigger: 'blur'}
|
||||||
|
],
|
||||||
|
answer: [
|
||||||
|
{required: true,validator: checkAnswer, trigger: 'blur'}
|
||||||
|
]
|
||||||
|
},
|
||||||
rules2: {
|
rules2: {
|
||||||
colpassword: [
|
colpassword: [
|
||||||
{required: true,validator: validatePass, trigger: 'blur'}
|
{required: true,validator: validatePass, trigger: 'blur'}
|
||||||
@@ -122,17 +150,30 @@ var Main = {
|
|||||||
type: 'success'
|
type: 'success'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
openNotiError(title, content) {
|
||||||
|
this.$notify.error({
|
||||||
|
title: title,
|
||||||
|
message: content
|
||||||
|
});
|
||||||
|
},
|
||||||
limitTime(row){
|
limitTime(row){
|
||||||
return DateDiff(row.worktime.replace(/([^\s]+)\s.*/, "$1"), cur);
|
return DateDiff(row.worktime.replace(/([^\s]+)\s.*/, "$1"), cur);
|
||||||
},
|
},
|
||||||
submitForm(formName, url) {
|
submitForm(formName, url) {
|
||||||
this.$refs[formName].validate((valid) => {
|
this.$refs[formName].validate((valid) => {
|
||||||
if (true) {//此处暂时去除校验
|
var that = this;
|
||||||
|
var params = new URLSearchParams();
|
||||||
|
params.append('userid', '55'); //你要传给后台的参数值 key/value
|
||||||
|
params.append('question', th.ruleForm3.question.value);
|
||||||
|
params.append('answer', th.ruleForm3.answer.value);
|
||||||
|
if (valid) {//此处暂时去除校验
|
||||||
axios({
|
axios({
|
||||||
url: getRootPath_web()+'/' + url,
|
url: getRootPath_web()+'/' + url,
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data: {
|
data: {
|
||||||
content: this.$refs.content.value
|
userid:th.ruleForm3.userid.value,
|
||||||
|
question:th.ruleForm3.question.value,
|
||||||
|
answer:th.ruleForm3.answer.value
|
||||||
},
|
},
|
||||||
transformRequest: [function (data) {
|
transformRequest: [function (data) {
|
||||||
// Do whatever you want to transform the data
|
// Do whatever you want to transform the data
|
||||||
@@ -145,13 +186,26 @@ var Main = {
|
|||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
}
|
}
|
||||||
})
|
}).then(function (response) {
|
||||||
console.log(this.$refs.content.value)
|
console.log(response.data);
|
||||||
this.openNotiSuccess("成功", "修改成功!")
|
if (response.data===true){
|
||||||
|
that.openNotiSuccess("成功", "修改成功!");
|
||||||
|
}else if (response.data===false){
|
||||||
|
that.openNotiError("失败", "修改失败!");
|
||||||
|
}else {
|
||||||
|
that.openNotiError("错误", response.data.message);
|
||||||
|
}
|
||||||
|
}).catch(function (error) {
|
||||||
|
console.log(error);
|
||||||
|
that.openNotiError("错误", "服务器错误!");
|
||||||
|
});
|
||||||
|
//console.log(this.$refs.content.value)
|
||||||
|
//this.openNotiSuccess("成功", "修改成功!")
|
||||||
//this.$options.methods.openNotiSuccess.bind(this)();
|
//this.$options.methods.openNotiSuccess.bind(this)();
|
||||||
//alert('submit!');
|
//alert('submit!');
|
||||||
} else {
|
} else {
|
||||||
console.log('error submit!!');
|
console.log('error submit!!');
|
||||||
|
that.openNotiError("错误", "表单填写错误!");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -66,6 +66,44 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row>
|
||||||
|
<h4>设置密保问题</h4>
|
||||||
|
<el-form
|
||||||
|
:model="ruleForm3" status-icon :rules="rules3" ref="ruleForm3"
|
||||||
|
label-width="100px" class="demo-ruleForm"
|
||||||
|
action="/cms/home/adduserque"
|
||||||
|
method="POST" name="ruleForm3">
|
||||||
|
<el-form-item label="ID"
|
||||||
|
prop="coluserid">
|
||||||
|
<el-input :readonly="true" v-model="ruleForm2.coluserid"
|
||||||
|
name="userid" readonly></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="问题"
|
||||||
|
prop="question">
|
||||||
|
<el-select v-model="ruleForm3.question" placeholder="请选择密保问题" name="question">
|
||||||
|
<el-option label="您母亲的姓名是?" value="您母亲的姓名是?"></el-option>
|
||||||
|
<el-option label="您父亲的姓名是?" value="您父亲的姓名是?"></el-option>
|
||||||
|
<el-option label="您配偶的姓名是?" value="您配偶的姓名是?"></el-option>
|
||||||
|
<el-option label="您的出生地是?" value="您的出生地是?"></el-option>
|
||||||
|
<el-option label="您高中班主任的名字是?" value="您高中班主任的名字是?"></el-option>
|
||||||
|
<el-option label="您初中班主任的名字是?" value="您初中班主任的名字是?"></el-option>
|
||||||
|
<el-option label="您的小学校名是?" value="您的小学校名是?"></el-option>
|
||||||
|
<el-option label="您最熟悉的童年好友名字是?" value="您最熟悉的童年好友名字是?"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="答案"
|
||||||
|
prop="answer">
|
||||||
|
<el-input v-model="ruleForm3.answer"
|
||||||
|
name="answer"></el-input>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary"
|
||||||
|
@click="submitForm('ruleForm3','home/adduserque')">提交
|
||||||
|
</el-button>
|
||||||
|
<el-button @click="resetForm('ruleForm3')">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :md="5" :lg="5" :sm="5" :xl="5" class="hidden-xs-only" :offset="1">
|
<el-col :md="5" :lg="5" :sm="5" :xl="5" class="hidden-xs-only" :offset="1">
|
||||||
<el-row>
|
<el-row>
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.fjy.spring.controller;
|
||||||
|
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
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;
|
||||||
|
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest
|
||||||
|
@AutoConfigureMockMvc
|
||||||
|
public class DataControllerTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MockMvc mvc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 使用此单元测试前要注销拦截器,否则测试不通过
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
@Transactional
|
||||||
|
public void adduserque() throws Exception{
|
||||||
|
mvc.perform(MockMvcRequestBuilders.post("/home/adduserque")
|
||||||
|
.param("coluserid","53")
|
||||||
|
.param("question","您母亲的姓名是?")
|
||||||
|
.param("answer","YHM"))
|
||||||
|
.andExpect(MockMvcResultMatchers.content().string("true"));
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user