实现用户仅能查看自己提交的文件
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.fjy.spring.controller;
|
||||
|
||||
import com.fjy.spring.domain.TbFile;
|
||||
import com.fjy.spring.domain.TbUser;
|
||||
import com.fjy.spring.enums.ResultEnum;
|
||||
import com.fjy.spring.exception.UserException;
|
||||
import com.fjy.spring.service.FileService;
|
||||
@@ -11,16 +12,22 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.util.List;
|
||||
|
||||
import static com.fjy.spring.constant.GlobalConstant.USER_SESSION_KEY;
|
||||
|
||||
@Controller
|
||||
public class DownLoadController {
|
||||
@Autowired
|
||||
private FileService fileService;
|
||||
|
||||
@Resource
|
||||
HttpServletRequest request;
|
||||
|
||||
/*@GetMapping("/download")
|
||||
public String toDownloadPage(){
|
||||
return "download/dodownload";
|
||||
@@ -36,6 +43,19 @@ public class DownLoadController {
|
||||
return null;
|
||||
}
|
||||
|
||||
@GetMapping("/download/findone")
|
||||
@ResponseBody
|
||||
public List<TbFile> toDownloadOne(){
|
||||
TbUser user = (TbUser)request.getSession().getAttribute(USER_SESSION_KEY);
|
||||
System.out.println(user.toString());
|
||||
List<TbFile> files = fileService.findByColuserid(user.getColuserid());
|
||||
//此处做空指针判断并抛出错误
|
||||
if (files!=null)
|
||||
return files;
|
||||
new UserException(ResultEnum.EMPTY_DATA);
|
||||
return null;
|
||||
}
|
||||
|
||||
@RequestMapping("/download/dodownload")
|
||||
public String download(@RequestParam Integer fileId , HttpServletRequest request, HttpServletResponse response){
|
||||
|
||||
|
||||
@@ -2,9 +2,16 @@ package com.fjy.spring.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.support.SessionStatus;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@Controller
|
||||
public class NavController {
|
||||
@Resource
|
||||
HttpServletRequest request;
|
||||
|
||||
@GetMapping(value = {"index",""})
|
||||
public String toLoginPage(){
|
||||
return "login";
|
||||
@@ -25,6 +32,13 @@ public class NavController {
|
||||
return "/home/home";
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/logout"})
|
||||
public String toLogOut(SessionStatus status){
|
||||
//request.getSession().getAttribute(USER_SESSION_KEY).invalidate();
|
||||
status.setComplete();
|
||||
return "login";
|
||||
}
|
||||
|
||||
@GetMapping(value = {"/home/feedback"})
|
||||
public String toFeedbackPage(){
|
||||
return "/home/feedback";
|
||||
@@ -55,7 +69,6 @@ public class NavController {
|
||||
return "/home/homework";
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = {"/home/user"})
|
||||
public String toUserPage(){
|
||||
return "/home/user";
|
||||
|
||||
@@ -7,7 +7,7 @@ import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Immutable
|
||||
@Subselect("SELECT * FROM v_log ORDER BY coltime LIMIT 0, 20")
|
||||
@Subselect("SELECT * FROM v_log ORDER BY coltime DESC LIMIT 0, 20")
|
||||
public class VLog {
|
||||
@Id
|
||||
private Integer logid;
|
||||
|
||||
@@ -9,4 +9,6 @@ public interface TbFileRepository extends JpaRepository<TbFile,Integer>{
|
||||
public List<TbFile> findByColfilename(String name);
|
||||
|
||||
public List<TbFile> findByWorkFolderAndCourseName(String workFolder,String courseName);
|
||||
|
||||
public List<TbFile> findByColuserid(Integer id);
|
||||
}
|
||||
|
||||
@@ -48,4 +48,8 @@ public class FileService {
|
||||
return tbFileRepository.findByWorkFolderAndCourseName(workFolder,courseName);
|
||||
}
|
||||
|
||||
public List<TbFile> findByColuserid(Integer id){
|
||||
return tbFileRepository.findByColuserid(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
472
src/main/resources/static/js/home.js
Normal file
472
src/main/resources/static/js/home.js
Normal file
@@ -0,0 +1,472 @@
|
||||
var dt = new Date();
|
||||
var month = dt.getMonth() + 1;
|
||||
var day = dt.getDate();
|
||||
var year = dt.getFullYear();
|
||||
var cur = year + '-' + month + '-' + day;
|
||||
|
||||
function DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式
|
||||
var aDate, oDate1, oDate2, iDays
|
||||
aDate = sDate1.split("-")
|
||||
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式
|
||||
aDate = sDate2.split("-")
|
||||
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
|
||||
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
|
||||
return iDays
|
||||
}
|
||||
|
||||
var Main = {
|
||||
data() {
|
||||
var checkName = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('用户名不能为空'));
|
||||
}
|
||||
};
|
||||
var checkNo = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('学号不能为空'));
|
||||
}
|
||||
};
|
||||
var checkRealName = (rule, value, callback) => {
|
||||
if (!value) {
|
||||
return callback(new Error('真实姓名不能为空'));
|
||||
}
|
||||
};
|
||||
var validatePass = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请输入密码'));
|
||||
} else {
|
||||
if (this.ruleForm2.checkPass !== '') {
|
||||
this.$refs.ruleForm2.validateField('checkPass');
|
||||
}
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var validatePass2 = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('请再次输入密码'));
|
||||
} else if (value !== this.ruleForm2.colpassword) {
|
||||
callback(new Error('两次输入密码不一致!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
return {
|
||||
feedbackForm: {
|
||||
content: ''
|
||||
},
|
||||
activeIndex: '1',
|
||||
dialogVisible: false,
|
||||
dialogTableVisible: false,
|
||||
ruleForm2: {
|
||||
colname: '',
|
||||
colpassword: '',
|
||||
checkPass: '',
|
||||
colstudentno: '',
|
||||
colrealname: '',
|
||||
colemail: ''
|
||||
},
|
||||
rules2: {
|
||||
colpassword: [
|
||||
{required: true, validator: validatePass, trigger: 'blur'}
|
||||
],
|
||||
checkPass: [
|
||||
{required: true, validator: validatePass2, trigger: 'blur'}
|
||||
],
|
||||
colstudentno: [
|
||||
{
|
||||
required: true,
|
||||
validator: checkNo,
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
colrealname: [
|
||||
{
|
||||
required: true,
|
||||
validator: checkRealName,
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
colname: [
|
||||
{required: true, validator: checkName, trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
activeName: 'login',
|
||||
fileList: [],
|
||||
DownloadList: [],
|
||||
VersionList:[
|
||||
{
|
||||
date:'2018-02-23',
|
||||
content:'修复用户信息修改页面数据绑定方式,改为使用axios进行数据获取和绑定',
|
||||
version:'V1.5',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-22',
|
||||
content:'实现后台对未交作业人员的查询',
|
||||
version:'V1.4',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-22',
|
||||
content:'实现用户信息修改',
|
||||
version:'V1.3.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-21',
|
||||
content:'实现用户信息修改页面session传值',
|
||||
version:'V1.3',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-09',
|
||||
content:'实现用户管理和作业管理数据读取',
|
||||
version:'V1.2.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-09',
|
||||
content:'实现单文件删除',
|
||||
version:'V1.2',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'完成课程管理数据读取,修复页面加载css,js错误',
|
||||
version:'V1.1.2',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'完成管理员主页的数据读取',
|
||||
version:'V1.1.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'完成前端界面设计',
|
||||
version:'V1.0',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'实现表单异步提交并显示消息',
|
||||
version:'V0.15',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-07',
|
||||
content:'实现作业上传自动创建文件夹',
|
||||
version:'V0.14',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-07',
|
||||
content:'实现作业获取和展示',
|
||||
version:'V0.13',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-06',
|
||||
content:'完成前端上传页面设计',
|
||||
version:'V0.12',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-06',
|
||||
content:'实现登录日志记录',
|
||||
version:'V0.11',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'提高加密安全性',
|
||||
version:'V0.10.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现用户密码SHA加密',
|
||||
version:'V0.10',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现登录拦截器',
|
||||
version:'V0.9',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现注册功能',
|
||||
version:'V0.8',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现json数据绑定',
|
||||
version:'V0.7',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-04',
|
||||
content:'实现多文件上传,按钮vue传值(vue2.1特性)',
|
||||
version:'V0.6',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-04',
|
||||
content:'实现Element组件+单文件上传',
|
||||
version:'V0.5',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-04',
|
||||
content:'使用thymeleaf模板引擎,引入frame框架和公用css和js文件',
|
||||
version:'V0.4',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-03',
|
||||
content:'实现文件上传和数据库记录、Element+vue登录注册UI',
|
||||
version:'V0.3',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-01-30',
|
||||
content:'实现登录,编写错误码,实现错误码返回json',
|
||||
version:'V0.2',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-01-30',
|
||||
content:'实现数据库查询用户,获取密码,编写了单元测试类',
|
||||
version:'V0.1',
|
||||
user:'F嘉阳'
|
||||
}
|
||||
],
|
||||
tableHomeworkData: [
|
||||
{
|
||||
workid: 1,
|
||||
colfileid: 56,
|
||||
workname: "实验报告",
|
||||
worktime: "2018-02-06 20:44:08.0",
|
||||
colfilename: "2018 服务器装机.xlsx",
|
||||
coursename: "信息安全",
|
||||
workremark: "3000字以上",
|
||||
workfolder: "第一次作业"
|
||||
},
|
||||
{
|
||||
workid: 1,
|
||||
colfileid: 56,
|
||||
workname: "实验报告2",
|
||||
worktime: "2018-02-08 20:44:08.0",
|
||||
colfilename: "2018 服务器装机.xlsx",
|
||||
coursename: "决策支持系统",
|
||||
workremark: "3000字以上",
|
||||
workfolder: "第一次作业"
|
||||
}
|
||||
],
|
||||
tableData2: [{
|
||||
date: '2016-05-02',
|
||||
}, {
|
||||
date: '2016-05-04',
|
||||
}, {
|
||||
date: '2016-05-01',
|
||||
}, {
|
||||
date: '2016-05-03',
|
||||
}],
|
||||
tableData3: [{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎'
|
||||
}, {
|
||||
date: '2016-05-04',
|
||||
name: '王小虎'
|
||||
}, {
|
||||
date: '2016-05-01',
|
||||
name: '王小虎'
|
||||
}, {
|
||||
date: '2016-05-03',
|
||||
name: '王小虎'
|
||||
}]
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
var that = this;
|
||||
axios.get(getRootPath_web()+'/download/findone')
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.DownloadList = response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
axios.get(getRootPath_web()+'/home/findAllHomework')
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.tableHomeworkData = response.data;
|
||||
//that.limitTime = response.data;
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
openNotiSuccess(title, content) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: content,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
openSuccess(content) {
|
||||
this.$message({
|
||||
message: content,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
uploadURL(row) {
|
||||
return "http://localhost:8080/cms/moreUpload?courseName=" + row.coursename + "&folder=" + row.workfolder;
|
||||
},
|
||||
limitTime(row) {
|
||||
return DateDiff(row.worktime.replace(/([^\s]+)\s.*/, "$1"), cur);
|
||||
},
|
||||
submitForm(formName, url) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios({
|
||||
url: 'http://localhost:8080/cms/' + url,
|
||||
method: 'post',
|
||||
data: {
|
||||
content: this.$refs.content.value
|
||||
},
|
||||
transformRequest: [function (data) {
|
||||
// Do whatever you want to transform the data
|
||||
let ret = ''
|
||||
for (let it in data) {
|
||||
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
||||
}
|
||||
return ret
|
||||
}],
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
})
|
||||
console.log(this.$refs.content.value)
|
||||
this.openNotiSuccess("成功", "反馈成功!")
|
||||
//this.$options.methods.openNotiSuccess.bind(this)();
|
||||
//alert('submit!');
|
||||
} else {
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
},
|
||||
handleClick(row) {
|
||||
console.log(row.colfileid);
|
||||
},
|
||||
submitUpload() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
ClickToJump(targe) {
|
||||
window.location.href = "http://localhost:8080/cms/" + targe;
|
||||
},
|
||||
handleDownload(row) {
|
||||
/*var url = window.location.protocol+"://"+window.location.host+":"+window.location.port+"/"*/
|
||||
window.open("http://localhost:8080/cms/download/dodownload?fileId=" + row.colfileid);
|
||||
},
|
||||
handleDelete(row) {
|
||||
axios({
|
||||
url: 'http://localhost:8080/cms/home/filedelete',
|
||||
method: 'post',
|
||||
data: {
|
||||
fileid: row.colfileid
|
||||
},
|
||||
transformRequest: [function (data) {
|
||||
// Do whatever you want to transform the data
|
||||
let ret = ''
|
||||
for (let it in data) {
|
||||
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
||||
}
|
||||
return ret
|
||||
}],
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
});
|
||||
this.openNotiSuccess("成功", "删除成功!");
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${ file.name }?`);
|
||||
},
|
||||
handleSelect(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
handleOpen(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
handleClose(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
dialogClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {
|
||||
});
|
||||
},
|
||||
showMsg(msg) {
|
||||
this.$message({
|
||||
message: msg,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
notiSuccess(title, value) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: value,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
notiWarning(title, value) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: value,
|
||||
type: 'warning'
|
||||
});
|
||||
},
|
||||
|
||||
notiInfo(title, value) {
|
||||
this.$notify.info({
|
||||
title: title,
|
||||
message: value
|
||||
});
|
||||
},
|
||||
|
||||
notiError(title, value) {
|
||||
this.$notify.error({
|
||||
title: title,
|
||||
message: value
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
var Ctor = Vue.extend(Main)
|
||||
var con = new Ctor().$mount('#app')
|
||||
//con.showMsg('登录成功');
|
||||
@@ -1,17 +1,19 @@
|
||||
var dt = new Date();
|
||||
var month = dt.getMonth()+1;
|
||||
var month = dt.getMonth() + 1;
|
||||
var day = dt.getDate();
|
||||
var year = dt.getFullYear();
|
||||
var cur = year + '-' + month + '-' + day;
|
||||
function DateDiff(sDate1, sDate2){ //sDate1和sDate2是2002-12-18格式
|
||||
var aDate, oDate1, oDate2, iDays
|
||||
aDate = sDate1.split("-")
|
||||
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式
|
||||
aDate = sDate2.split("-")
|
||||
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
|
||||
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 /24) //把相差的毫秒数转换为天数
|
||||
return iDays
|
||||
|
||||
function DateDiff(sDate1, sDate2) { //sDate1和sDate2是2002-12-18格式
|
||||
var aDate, oDate1, oDate2, iDays
|
||||
aDate = sDate1.split("-")
|
||||
oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]) //转换为12-18-2002格式
|
||||
aDate = sDate2.split("-")
|
||||
oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0])
|
||||
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24) //把相差的毫秒数转换为天数
|
||||
return iDays
|
||||
}
|
||||
|
||||
var Main = {
|
||||
data() {
|
||||
var checkName = (rule, value, callback) => {
|
||||
@@ -54,20 +56,21 @@ var Main = {
|
||||
},
|
||||
activeIndex: '1',
|
||||
dialogVisible: false,
|
||||
dialogTableVisible: false,
|
||||
ruleForm2: {
|
||||
colname: '',
|
||||
colpassword: '',
|
||||
checkPass:'',
|
||||
checkPass: '',
|
||||
colstudentno: '',
|
||||
colrealname: '',
|
||||
colemail: ''
|
||||
},
|
||||
rules2: {
|
||||
colpassword: [
|
||||
{required: true,validator: validatePass, trigger: 'blur'}
|
||||
{required: true, validator: validatePass, trigger: 'blur'}
|
||||
],
|
||||
checkPass: [
|
||||
{required: true,validator: validatePass2, trigger: 'blur'}
|
||||
{required: true, validator: validatePass2, trigger: 'blur'}
|
||||
],
|
||||
colstudentno: [
|
||||
{
|
||||
@@ -84,12 +87,164 @@ var Main = {
|
||||
}
|
||||
],
|
||||
colname: [
|
||||
{required: true,validator: checkName, trigger: 'blur'}
|
||||
{required: true, validator: checkName, trigger: 'blur'}
|
||||
],
|
||||
},
|
||||
activeName:'login',
|
||||
activeName: 'login',
|
||||
fileList: [],
|
||||
DownloadList: [],
|
||||
VersionList:[
|
||||
{
|
||||
date:'2018-02-23',
|
||||
content:'修复用户信息修改页面数据绑定方式,改为使用axios进行数据获取和绑定',
|
||||
version:'V1.5',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-22',
|
||||
content:'实现后台对未交作业人员的查询',
|
||||
version:'V1.4',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-22',
|
||||
content:'实现用户信息修改',
|
||||
version:'V1.3.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-21',
|
||||
content:'实现用户信息修改页面session传值',
|
||||
version:'V1.3',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-09',
|
||||
content:'实现用户管理和作业管理数据读取',
|
||||
version:'V1.2.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-09',
|
||||
content:'实现单文件删除',
|
||||
version:'V1.2',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'完成课程管理数据读取,修复页面加载css,js错误',
|
||||
version:'V1.1.2',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'完成管理员主页的数据读取',
|
||||
version:'V1.1.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'完成前端界面设计',
|
||||
version:'V1.0',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-08',
|
||||
content:'实现表单异步提交并显示消息',
|
||||
version:'V0.15',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-07',
|
||||
content:'实现作业上传自动创建文件夹',
|
||||
version:'V0.14',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-07',
|
||||
content:'实现作业获取和展示',
|
||||
version:'V0.13',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-06',
|
||||
content:'完成前端上传页面设计',
|
||||
version:'V0.12',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-06',
|
||||
content:'实现登录日志记录',
|
||||
version:'V0.11',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'提高加密安全性',
|
||||
version:'V0.10.1',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现用户密码SHA加密',
|
||||
version:'V0.10',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现登录拦截器',
|
||||
version:'V0.9',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现注册功能',
|
||||
version:'V0.8',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-05',
|
||||
content:'实现json数据绑定',
|
||||
version:'V0.7',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-04',
|
||||
content:'实现多文件上传,按钮vue传值(vue2.1特性)',
|
||||
version:'V0.6',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-04',
|
||||
content:'实现Element组件+单文件上传',
|
||||
version:'V0.5',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-04',
|
||||
content:'使用thymeleaf模板引擎,引入frame框架和公用css和js文件',
|
||||
version:'V0.4',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-02-03',
|
||||
content:'实现文件上传和数据库记录、Element+vue登录注册UI',
|
||||
version:'V0.3',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-01-30',
|
||||
content:'实现登录,编写错误码,实现错误码返回json',
|
||||
version:'V0.2',
|
||||
user:'F嘉阳'
|
||||
},
|
||||
{
|
||||
date:'2018-01-30',
|
||||
content:'实现数据库查询用户,获取密码,编写了单元测试类',
|
||||
version:'V0.1',
|
||||
user:'F嘉阳'
|
||||
}
|
||||
],
|
||||
tableHomeworkData: [
|
||||
{
|
||||
workid: 1,
|
||||
@@ -139,7 +294,7 @@ var Main = {
|
||||
mounted() {
|
||||
this.$nextTick(() => {
|
||||
var that = this;
|
||||
axios.get('http://localhost:8080/cms/download/findall')
|
||||
axios.get(getRootPath_web()+'/download/findone')
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.DownloadList = response.data;
|
||||
@@ -147,7 +302,7 @@ var Main = {
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
axios.get('http://localhost:8080/cms/home/findAllHomework')
|
||||
axios.get(getRootPath_web()+'/home/findAllHomework')
|
||||
.then(function (response) {
|
||||
console.log(response.data);
|
||||
that.tableHomeworkData = response.data;
|
||||
@@ -159,7 +314,8 @@ var Main = {
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
openNotiSuccess(title,content) {
|
||||
|
||||
openNotiSuccess(title, content) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: content,
|
||||
@@ -172,17 +328,17 @@ var Main = {
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
uploadURL(row){
|
||||
return "http://localhost:8080/cms/moreUpload?courseName="+row.coursename+"&folder="+row.workfolder;
|
||||
uploadURL(row) {
|
||||
return "http://localhost:8080/cms/moreUpload?courseName=" + row.coursename + "&folder=" + row.workfolder;
|
||||
},
|
||||
limitTime(row){
|
||||
return DateDiff(row.worktime.replace(/([^\s]+)\s.*/, "$1"), cur);
|
||||
limitTime(row) {
|
||||
return DateDiff(row.worktime.replace(/([^\s]+)\s.*/, "$1"), cur);
|
||||
},
|
||||
submitForm(formName,url) {
|
||||
submitForm(formName, url) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
axios({
|
||||
url: 'http://localhost:8080/cms/'+url,
|
||||
url: 'http://localhost:8080/cms/' + url,
|
||||
method: 'post',
|
||||
data: {
|
||||
content: this.$refs.content.value
|
||||
@@ -200,7 +356,7 @@ var Main = {
|
||||
}
|
||||
})
|
||||
console.log(this.$refs.content.value)
|
||||
this.openNotiSuccess("成功","反馈成功!")
|
||||
this.openNotiSuccess("成功", "反馈成功!")
|
||||
//this.$options.methods.openNotiSuccess.bind(this)();
|
||||
//alert('submit!');
|
||||
} else {
|
||||
@@ -212,23 +368,23 @@ var Main = {
|
||||
resetForm(formName) {
|
||||
this.$refs[formName].resetFields();
|
||||
},
|
||||
handleClick(row) {
|
||||
console.log(row.colfileid);
|
||||
},
|
||||
submitUpload() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
ClickToJump(targe){
|
||||
window.location.href="http://localhost:8080/cms/" + targe;
|
||||
},
|
||||
handleDownload(row) {
|
||||
/*var url = window.location.protocol+"://"+window.location.host+":"+window.location.port+"/"*/
|
||||
window.open("http://localhost:8080/cms/download/dodownload?fileId=" + row.colfileid);
|
||||
},
|
||||
handleDelete(row) {
|
||||
handleClick(row) {
|
||||
console.log(row.colfileid);
|
||||
},
|
||||
submitUpload() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
handleRemove(file, fileList) {
|
||||
console.log(file, fileList);
|
||||
},
|
||||
ClickToJump(targe) {
|
||||
window.location.href = "http://localhost:8080/cms/" + targe;
|
||||
},
|
||||
handleDownload(row) {
|
||||
/*var url = window.location.protocol+"://"+window.location.host+":"+window.location.port+"/"*/
|
||||
window.open("http://localhost:8080/cms/download/dodownload?fileId=" + row.colfileid);
|
||||
},
|
||||
handleDelete(row) {
|
||||
axios({
|
||||
url: 'http://localhost:8080/cms/home/filedelete',
|
||||
method: 'post',
|
||||
@@ -247,69 +403,70 @@ var Main = {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
});
|
||||
this.openNotiSuccess("成功","删除成功!");
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${ file.name }?`);
|
||||
},
|
||||
handleSelect(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
handleOpen(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
handleClose(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
dialogClose(done) {
|
||||
this.openNotiSuccess("成功", "删除成功!");
|
||||
},
|
||||
handlePreview(file) {
|
||||
console.log(file);
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
|
||||
},
|
||||
beforeRemove(file, fileList) {
|
||||
return this.$confirm(`确定移除 ${ file.name }?`);
|
||||
},
|
||||
handleSelect(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
handleOpen(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
handleClose(key, keyPath) {
|
||||
console.log(key, keyPath);
|
||||
},
|
||||
dialogClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
.catch(_ => {
|
||||
});
|
||||
},
|
||||
showMsg(msg) {
|
||||
this.$message({
|
||||
message: msg,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
notiSuccess(title, value) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: value,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
notiWarning(title, value) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: value,
|
||||
type: 'warning'
|
||||
});
|
||||
},
|
||||
showMsg(msg) {
|
||||
this.$message({
|
||||
message: msg,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
notiSuccess(title, value) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: value,
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
notiWarning(title, value) {
|
||||
this.$notify({
|
||||
title: title,
|
||||
message: value,
|
||||
type: 'warning'
|
||||
});
|
||||
},
|
||||
|
||||
notiInfo(title, value) {
|
||||
this.$notify.info({
|
||||
title: title,
|
||||
message: value
|
||||
});
|
||||
},
|
||||
notiInfo(title, value) {
|
||||
this.$notify.info({
|
||||
title: title,
|
||||
message: value
|
||||
});
|
||||
},
|
||||
|
||||
notiError(title, value) {
|
||||
this.$notify.error({
|
||||
title: title,
|
||||
message: value
|
||||
});
|
||||
notiError(title, value) {
|
||||
this.$notify.error({
|
||||
title: title,
|
||||
message: value
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var Ctor = Vue.extend(Main)
|
||||
var con = new Ctor().$mount('#app')
|
||||
//con.showMsg('登录成功');
|
||||
|
||||
@@ -34,6 +34,22 @@
|
||||
<li>异常统一管理</li>
|
||||
</ul>
|
||||
<br>
|
||||
<ul>
|
||||
<h3>开发人员</h3>
|
||||
<li><strong>界面布局设计 </strong>蓝钜</li>
|
||||
<li><strong>代码开发 </strong>符嘉阳</li>
|
||||
</ul>
|
||||
<br>
|
||||
<el-button type="text" @click="dialogTableVisible = true">查看更新日志</el-button>
|
||||
|
||||
<el-dialog title="GitLab更新日志" :visible.sync="dialogTableVisible">
|
||||
<el-table :data="VersionList">
|
||||
<el-table-column property="date" label="日期"></el-table-column>
|
||||
<el-table-column property="content" label="内容"></el-table-column>
|
||||
<el-table-column property="version" label="版本"></el-table-column>
|
||||
<el-table-column property="user" label="提交人员"></el-table-column>
|
||||
</el-table>
|
||||
</el-dialog>
|
||||
<ul>
|
||||
<h3>友情链接</h3>
|
||||
<li><a href="http://web.fjy8018.top:8080/blog/">F嘉阳 博客</a></li>
|
||||
@@ -48,7 +64,6 @@
|
||||
</el-container>
|
||||
</el-container>
|
||||
</div>
|
||||
<script th:src="@{/js/homePage.js}"></script>
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
<script th:src="@{/js/home.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -77,6 +77,5 @@
|
||||
</el-container>
|
||||
</div>
|
||||
<script th:src="@{/js/admin.js}"></script>
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -38,6 +38,5 @@
|
||||
</el-container>
|
||||
</div>
|
||||
<script th:src="@{/js/homePage.js}"></script>
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -304,7 +304,6 @@
|
||||
</el-container>
|
||||
</el-container>
|
||||
</div>
|
||||
<script th:src="@{/js/homePage.js}"></script>
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
<script th:src="@{/js/home.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -72,6 +72,5 @@
|
||||
</el-container>
|
||||
</div>
|
||||
<script th:src="@{/js/managecourse.js}"></script>
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -51,6 +51,5 @@
|
||||
</el-container>
|
||||
</div>
|
||||
<script th:src="@{/js/manageuser.js}"></script>
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -109,6 +109,5 @@
|
||||
</el-container>
|
||||
</div>
|
||||
<script th:src="@{/js/user.js}"></script>
|
||||
<script th:src="@{/js/common.js}"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user