From 90c9b2e3329fa0e5091b6d16002096cddd882020 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=E5=98=89=E9=98=B3?= Date: Tue, 27 Feb 2018 10:36:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=92=8C=E5=88=A0=E9=99=A4=E5=90=8E=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-prod.yml | 2 +- src/main/resources/application.yml | 2 +- src/main/resources/logback-spring.xml | 16 +++++------ src/main/resources/static/js/homepage.js | 32 ++++++++++++++------- src/main/resources/templates/home/home.html | 4 +++ 5 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 49bdd44..abf1b06 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -9,7 +9,7 @@ serverproperties: spring: thymeleaf: prefix: classpath:/templates/ - cache: false + cache: true check-template: true datasource: diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7ef289a..9efaa1c 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,4 +1,4 @@ #控制配置文件调用 spring: profiles: - active: prod \ No newline at end of file + active: dev \ No newline at end of file diff --git a/src/main/resources/logback-spring.xml b/src/main/resources/logback-spring.xml index 272ad8e..e80b7f5 100644 --- a/src/main/resources/logback-spring.xml +++ b/src/main/resources/logback-spring.xml @@ -25,13 +25,13 @@ - - /www/cmsfile/%d/info.%d.log - - + F:\JAVA Workspace\Temp\log\%d\info.%d.log + + + - - + + ERROR @@ -44,8 +44,8 @@ - - /www/cmsfile/%d/error.%d.log + F:\JAVA Workspace\Temp\log\error.%d.log + diff --git a/src/main/resources/static/js/homepage.js b/src/main/resources/static/js/homepage.js index f0672b2..3d5271a 100644 --- a/src/main/resources/static/js/homepage.js +++ b/src/main/resources/static/js/homepage.js @@ -163,15 +163,11 @@ var Main = { }, 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); - }); + let that = this; + /*setInterval(function(){ + that.getFileList(); + },1000);*/ + this.getFileList(); axios.get(getRootPath_web()+'/home/findAllHomework') .then(function (response) { console.log(response.data); @@ -202,6 +198,18 @@ var Main = { }) }, methods: { + getFileList(){ + let 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); + that.openNotiError("失败", "获取文件列表失败!"); + }); + }, openNotiSuccess(title, content) { this.$notify({ title: title, @@ -279,7 +287,10 @@ var Main = { console.log(row.colfileid); }, submitUpload() { + let that = this; this.$refs.upload.submit(); + this.openNotiSuccess("成功", "文件上传成功!"); + setTimeout(function () {that.getFileList();},1000); }, handleRemove(file, fileList) { console.log(file, fileList); @@ -315,7 +326,8 @@ var Main = { if (response.data===true){ //that.$refs[formName].submit; //return true; - that.openNotiSuccess("成功", "删除成功!") + that.openNotiSuccess("成功", "删除成功!"); + that.getFileList(); }else if (response.data===false){ that.openNotiError("失败", "删除失败!"); }else { diff --git a/src/main/resources/templates/home/home.html b/src/main/resources/templates/home/home.html index 300cf12..9e56a5c 100644 --- a/src/main/resources/templates/home/home.html +++ b/src/main/resources/templates/home/home.html @@ -237,6 +237,10 @@ + + + +