Commit 3cf72537 authored by xiujunlian's avatar xiujunlian

附件修改

parent 7bf678e9
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
<!-- 继承自AuthorizingRealm的自定义Realm,即指定Shiro验证用户登录的类为自定义的UserRealm.java -->
<bean id="userRealm" class="com.hmit.kernes.shiro.UserRealm"/>
<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<!-- 设置session过期时间为1小时(单位:毫秒),默认为30分钟 -->
<property name="globalSessionTimeout" value="3600000"></property>
<property name="sessionValidationSchedulerEnabled" value="true"></property>
</bean>
<!-- Shiro默认会使用Servlet容器的Session,可通过sessionMode属性来指定使用Shiro原生Session -->
<!-- 即<property name="sessionMode" value="native"/>,详细说明见官方文档 -->
<!-- 这里主要是设置自定义的单Realm应用,若有多个Realm,可使用'realms'属性代替 -->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="sessionManager" ref="sessionManager"></property>
<property name="realm" ref="userRealm"/>
</bean>
<!-- Shiro主过滤器本身功能十分强大,其强大之处就在于它支持任何基于URL路径表达式的、自定义的过滤器的执行 -->
<!-- Web应用中,Shiro可控制的Web请求必须经过Shiro主过滤器的拦截,Shiro对基于Spring的Web应用提供了完美的支持 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<!-- Shiro的核心安全接口,这个属性是必须的 -->
<property name="securityManager" ref="securityManager"/>
<!-- 要求登录时的链接(可根据项目的URL进行替换),非必须的属性,默认会自动寻找Web工程根目录下的"/login.html"页面 -->
<property name="loginUrl" value="/login.html"/>
<!-- 登录成功后要跳转的连接 -->
<property name="successUrl" value="/index1.html"/>
<!-- 用户访问未对其授权的资源时,所显示的连接 -->
<!-- 若想更明显的测试此属性可以修改它的值,如unauthor.jsp,然后用[玄玉]登录后访问/admin/listUser.jsp就看见浏览器会显示unauthor.jsp -->
<property name="unauthorizedUrl" value="/login.html"/>
<!-- Shiro连接约束配置,即过滤链的定义 -->
<!-- 此处可配合我的这篇文章来理解各个过滤连的作用http://blog.csdn.net/jadyer/article/details/12172839 -->
<!-- 下面value值的第一个'/'代表的路径是相对于HttpServletRequest.getContextPath()的值来的 -->
<!-- anon:它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种 -->
<!-- authc:该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter -->
<property name="filterChainDefinitions">
<value>
/=anon
/statics/**=anon
/page/**=anon
/js/**=anon
/img/**=anon
/doc/**=anon
/file/**=anon
/api/**=anon
/jk/**=anon
/zhgh/**=anon
/qt/**=anon
/index.html=anon
/login.html=anon
/sys/login=anon
/captcha.jpg=anon
/test.html=anon
/artlist=anon
/sys/menu/querymenuList=anon
/sys/menu/querymenu=anon
/sys/menu/visitor=anon
/queryArtList=anon
/queryArticle=anon
/getphotolist=anon
/getAllarticleCast=anon
/**=authc
</value>
</property>
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
<!-- AOP式方法级权限检查 -->
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor">
<property name="proxyTargetClass" value="true" />
</bean>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager"/>
</bean>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
<!-- 继承自AuthorizingRealm的自定义Realm,即指定Shiro验证用户登录的类为自定义的UserRealm.java -->
<bean id="userRealm" class="com.hmit.kernes.shiro.UserRealm"/>
<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<!-- 设置session过期时间为1小时(单位:毫秒),默认为30分钟 -->
<property name="globalSessionTimeout" value="3600000"></property>
<property name="sessionValidationSchedulerEnabled" value="true"></property>
</bean>
<!-- Shiro默认会使用Servlet容器的Session,可通过sessionMode属性来指定使用Shiro原生Session -->
<!-- 即<property name="sessionMode" value="native"/>,详细说明见官方文档 -->
<!-- 这里主要是设置自定义的单Realm应用,若有多个Realm,可使用'realms'属性代替 -->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="sessionManager" ref="sessionManager"></property>
<property name="realm" ref="userRealm"/>
</bean>
<!-- Shiro主过滤器本身功能十分强大,其强大之处就在于它支持任何基于URL路径表达式的、自定义的过滤器的执行 -->
<!-- Web应用中,Shiro可控制的Web请求必须经过Shiro主过滤器的拦截,Shiro对基于Spring的Web应用提供了完美的支持 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<!-- Shiro的核心安全接口,这个属性是必须的 -->
<property name="securityManager" ref="securityManager"/>
<!-- 要求登录时的链接(可根据项目的URL进行替换),非必须的属性,默认会自动寻找Web工程根目录下的"/login.html"页面 -->
<property name="loginUrl" value="/login.html"/>
<!-- 登录成功后要跳转的连接 -->
<property name="successUrl" value="/index1.html"/>
<!-- 用户访问未对其授权的资源时,所显示的连接 -->
<!-- 若想更明显的测试此属性可以修改它的值,如unauthor.jsp,然后用[玄玉]登录后访问/admin/listUser.jsp就看见浏览器会显示unauthor.jsp -->
<property name="unauthorizedUrl" value="/login.html"/>
<!-- Shiro连接约束配置,即过滤链的定义 -->
<!-- 此处可配合我的这篇文章来理解各个过滤连的作用http://blog.csdn.net/jadyer/article/details/12172839 -->
<!-- 下面value值的第一个'/'代表的路径是相对于HttpServletRequest.getContextPath()的值来的 -->
<!-- anon:它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种 -->
<!-- authc:该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter -->
<property name="filterChainDefinitions">
<value>
/=anon
/statics/**=anon
/page/**=anon
/js/**=anon
/img/**=anon
/doc/**=anon
/file/**=anon
/api/**=anon
/jk/**=anon
/zhgh/**=anon
/qt/**=anon
/index.html=anon
/login.html=anon
/sys/login=anon
/captcha.jpg=anon
/test.html=anon
/artlist=anon
/sys/menu/querymenuList=anon
/sys/menu/querymenu=anon
/queryArtList=anon
/queryArticle=anon
/getphotolist=anon
/getAllarticleCast=anon
/**=authc
</value>
</property>
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
<!-- AOP式方法级权限检查 -->
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor">
<property name="proxyTargetClass" value="true" />
</bean>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager"/>
</bean>
</beans>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
<!-- 继承自AuthorizingRealm的自定义Realm,即指定Shiro验证用户登录的类为自定义的UserRealm.java -->
<bean id="userRealm" class="com.hmit.kernes.shiro.UserRealm"/>
<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<!-- 设置session过期时间为1小时(单位:毫秒),默认为30分钟 -->
<property name="globalSessionTimeout" value="3600000"></property>
<property name="sessionValidationSchedulerEnabled" value="true"></property>
</bean>
<!-- Shiro默认会使用Servlet容器的Session,可通过sessionMode属性来指定使用Shiro原生Session -->
<!-- 即<property name="sessionMode" value="native"/>,详细说明见官方文档 -->
<!-- 这里主要是设置自定义的单Realm应用,若有多个Realm,可使用'realms'属性代替 -->
<bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="sessionManager" ref="sessionManager"></property>
<property name="realm" ref="userRealm"/>
</bean>
<!-- Shiro主过滤器本身功能十分强大,其强大之处就在于它支持任何基于URL路径表达式的、自定义的过滤器的执行 -->
<!-- Web应用中,Shiro可控制的Web请求必须经过Shiro主过滤器的拦截,Shiro对基于Spring的Web应用提供了完美的支持 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<!-- Shiro的核心安全接口,这个属性是必须的 -->
<property name="securityManager" ref="securityManager"/>
<!-- 要求登录时的链接(可根据项目的URL进行替换),非必须的属性,默认会自动寻找Web工程根目录下的"/login.html"页面 -->
<property name="loginUrl" value="/login.html"/>
<!-- 登录成功后要跳转的连接 -->
<property name="successUrl" value="/index1.html"/>
<!-- 用户访问未对其授权的资源时,所显示的连接 -->
<!-- 若想更明显的测试此属性可以修改它的值,如unauthor.jsp,然后用[玄玉]登录后访问/admin/listUser.jsp就看见浏览器会显示unauthor.jsp -->
<property name="unauthorizedUrl" value="/login.html"/>
<!-- Shiro连接约束配置,即过滤链的定义 -->
<!-- 此处可配合我的这篇文章来理解各个过滤连的作用http://blog.csdn.net/jadyer/article/details/12172839 -->
<!-- 下面value值的第一个'/'代表的路径是相对于HttpServletRequest.getContextPath()的值来的 -->
<!-- anon:它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种 -->
<!-- authc:该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter -->
<property name="filterChainDefinitions">
<value>
/=anon
/statics/**=anon
/page/**=anon
/js/**=anon
/img/**=anon
/doc/**=anon
/file/**=anon
/api/**=anon
/jk/**=anon
/zhgh/**=anon
/qt/**=anon
/index.html=anon
/login.html=anon
/sys/login=anon
/captcha.jpg=anon
/test.html=anon
/artlist=anon
/sys/menu/querymenuList=anon
/sys/menu/querymenu=anon
/sys/menu/visitor=anon
/queryArtList=anon
/queryArticle=anon
/getphotolist=anon
/getAllarticleCast=anon
/**=authc
</value>
</property>
</bean>
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/>
<!-- AOP式方法级权限检查 -->
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor">
<property name="proxyTargetClass" value="true" />
</bean>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
<property name="securityManager" ref="securityManager"/>
</bean>
</beans>
\ No newline at end of file
...@@ -41,9 +41,15 @@ ...@@ -41,9 +41,15 @@
<script src="${rc.contextPath}/js/jk/bootstrap-datetimepicker.zh-CN.js"></script>--> <script src="${rc.contextPath}/js/jk/bootstrap-datetimepicker.zh-CN.js"></script>-->
<script src="${rc.contextPath}/js/dropzone.js"></script> <script src="${rc.contextPath}/js/dropzone.js"></script>
<!-- 引入样式 -->
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
</head> </head>
<style> <style>
.el-upload__input {
display: none !important;
}
.edui-editor-bottomContainer .edui-notadd{ .edui-editor-bottomContainer .edui-notadd{
display:none !important; display:none !important;
} }
...@@ -176,8 +182,21 @@ ...@@ -176,8 +182,21 @@
<div class="form-group"> <div class="form-group">
<div class="col-sm-2 control-label">附件</div> <div class="col-sm-2 control-label">附件</div>
<div class="col-sm-10"> <div class="col-sm-10">
<input type="text" class="form-control" v-model="jgSubject.file" style="display:none"/> <el-upload
<div id="file" class="dropzone" style="border: 1px solid #ccc;width:300px;height:30px;float: left;"></div> class="upload-demo"
action="../jk/jgsubject/uploadfile"
:on-exceed="handleExceed"
:on-preview="handlePreview"
:on-remove="handleRemove"
:on-success="handleSuccess"
multiple
:limit="10"
:file-list="fileList">
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">只能上传10个文件,且单个文件不超过10M</div>
</el-upload>
<!--<input type="text" class="form-control" v-model="jgSubject.file" style="display:none"/>
<div id="file" class="dropzone" style="border: 1px solid #ccc;width:300px;height:30px;float: left;"></div>-->
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
......
...@@ -85,8 +85,9 @@ ...@@ -85,8 +85,9 @@
<!--&lt;!&ndash;<img :src="'http://localhost:8080/doc/'+article.atta" title="IMG_1145.JPG" _src="" alt="" border="0" vspace="0">&ndash;&gt;--> <!--&lt;!&ndash;<img :src="'http://localhost:8080/doc/'+article.atta" title="IMG_1145.JPG" _src="" alt="" border="0" vspace="0">&ndash;&gt;-->
<!--<img :src="'/doc/'+article.atta" title="IMG_1145.JPG" _src="" alt="" border="0" vspace="0">--> <!--<img :src="'/doc/'+article.atta" title="IMG_1145.JPG" _src="" alt="" border="0" vspace="0">-->
<!--</p>--> <!--</p>-->
<div style="margin-bottom: 10px;" v-html="article.content"></div> <div style="margin-bottom: 10px;" v-html="article.content" ></div>
<a :href="'/file/'+article.file" v-if="article.file">附件:{{article.file}}</a> <!--<a :href="'/file/'+article.file" v-if="article.file">附件:{{article.file}}</a>-->
<div id="ahref"></div>
</div> </div>
<!--<div class="close"> <!--<div class="close">
<a href="javascript:window.close();">【关闭】</a> <a href="javascript:window.close();">【关闭】</a>
...@@ -368,7 +369,8 @@ ...@@ -368,7 +369,8 @@
// sortId:null, // sortId:null,
dqwz: null, dqwz: null,
barNameChilds: [], barNameChilds: [],
article: [] article: [],
shtml:""
}, },
mounted: function () { mounted: function () {
//这个是钩子函数 //这个是钩子函数
...@@ -382,6 +384,8 @@ ...@@ -382,6 +384,8 @@
//this.initArticleData(GetQueryString("sortId")); //this.initArticleData(GetQueryString("sortId"));
} }
// this.initInfoData() // this.initInfoData()
//$("#articleContent").append(shtml);
}) })
}, },
methods: { methods: {
...@@ -432,7 +436,22 @@ ...@@ -432,7 +436,22 @@
vm.article.pubDate = vm.article.pubDate.substring(0, 10); vm.article.pubDate = vm.article.pubDate.substring(0, 10);
vm.article.declareId = vm.article.menuId; vm.article.declareId = vm.article.menuId;
vm.article.menuId = vm.article.menuId.substring(0, 3); vm.article.menuId = vm.article.menuId.substring(0, 3);
vm.shtml="";
if(vm.article.file!=null&&""!=vm.article.file){
var list=[];
vm.shtml="附件:";
if(vm.article.file.valueOf(",")!=-1) {
list = vm.article.file.split(",");
list.forEach(function (value, index) {
vm.shtml += "<a href=\"/file/" + value + "\" v-if=\"" + value + "\">" + value + "</a><br>"
}
);
}else{
vm.shtml += "<a href=\"/file/" + vm.article.file + "\" v-if=\"" + vm.article.file + "\">" + vm.article.file + "</a><br>"
}
var articleContent = document.getElementById("ahref");
articleContent.innerHTML=vm.shtml;
}
$.ajax({ $.ajax({
type: 'get', type: 'get',
...@@ -1275,7 +1294,6 @@ ...@@ -1275,7 +1294,6 @@
} }
} }
}); });
// 手机号码验证 // 手机号码验证
jQuery.validator.addMethod("isMobile", function(value, element) { jQuery.validator.addMethod("isMobile", function(value, element) {
var length = value.length; var length = value.length;
......
...@@ -139,7 +139,8 @@ var vm = new Vue({ ...@@ -139,7 +139,8 @@ var vm = new Vue({
rankEntity:{}, rankEntity:{},
pubDate:'' pubDate:''
}, },
rank:[] rank:[],
fileList:[]
}, },
mounted:function(){ mounted:function(){
$.ajax({ $.ajax({
...@@ -227,8 +228,8 @@ var vm = new Vue({ ...@@ -227,8 +228,8 @@ var vm = new Vue({
$("#photo").empty(); $("#photo").empty();
$("#photo").append("drop files here to upload"); $("#photo").append("drop files here to upload");
$("#file").empty(); //$("#file").empty();
$("#file").append("drop files here to upload"); //$("#file").append("drop files here to upload");
}, },
update: function (event) { update: function (event) {
isUsedPhotoOrFile=false; isUsedPhotoOrFile=false;
...@@ -245,14 +246,25 @@ var vm = new Vue({ ...@@ -245,14 +246,25 @@ var vm = new Vue({
$("#photo").empty(); $("#photo").empty();
// $("#photo").append("drop files here to upload"); // $("#photo").append("drop files here to upload");
$("#file").empty(); //$("#file").empty();
// $("#file").append("drop files here to upload"); // $("#file").append("drop files here to upload");
}, },
saveOrUpdate: function (event) { saveOrUpdate: function (event) {
$('#orgSave').prop('disabled', true); $('#orgSave').prop('disabled', true);
vm.jgSubject.menuId = id ; vm.jgSubject.menuId = id ;
vm.jgSubject.atta = photo ; vm.jgSubject.atta = photo ;
vm.jgSubject.file = myname ; //vm.jgSubject.file = myname ;
if(vm.fileList.length!=0){
var filename="";
vm.fileList.forEach(function (val,index) {
filename=filename+val.name;
if(index!=vm.fileList.length-1){
filename=filename+","
}
});
vm.jgSubject.file=filename;
}
//vm.jgSubject.content = UM.getEditor('myEditor').getContent(); //vm.jgSubject.content = UM.getEditor('myEditor').getContent();
//vm.jgSubject.content=editor.getValue(); //vm.jgSubject.content=editor.getValue();
vm.jgSubject.content = ue.getContent(); vm.jgSubject.content = ue.getContent();
...@@ -305,17 +317,34 @@ var vm = new Vue({ ...@@ -305,17 +317,34 @@ var vm = new Vue({
//UM.getEditor('myEditor').setContent(vm.jgSubject.content,false); //UM.getEditor('myEditor').setContent(vm.jgSubject.content,false);
//editor.setValue (vm.jgSubject.content) //editor.setValue (vm.jgSubject.content)
ue.setContent(vm.jgSubject.content); ue.setContent(vm.jgSubject.content);
vm.fileList = [];
if(vm.jgSubject.atta!=null){ if(vm.jgSubject.atta!=null){
$("#photo").append('<img src="../doc/'+vm.jgSubject.atta+'" style="height: 110px;width: 220px;"/>'); $("#photo").append('<img src="../doc/'+vm.jgSubject.atta+'" style="height: 110px;width: 220px;"/>');
}else{ }else{
$("#photo").append("drop files here to upload"); $("#photo").append("drop files here to upload");
} }
if(vm.jgSubject.file!=null){ /* if(vm.jgSubject.file!=null){
$("#file").append(vm.jgSubject.file); $("#file").append(vm.jgSubject.file);
}else{ }else{
$("#file").append("drop files here to upload"); $("#file").append("drop files here to upload");
}*/
if(vm.jgSubject.file!=null&&""!=vm.jgSubject.file) {
var list = [];
if (vm.jgSubject.file.valueOf(",") != -1) {
list = vm.jgSubject.file.split(",");
list.forEach(function (value, index) {
vm.fileList.push({
"name": value,
"url": "../file" + value
})
});
}else{
vm.fileList.push({
"name": vm.jgSubject.file,
"url": "../file" + vm.jgSubject.file
})
}
} }
if(r.jgSubject.flag===""||r.jgSubject.flag===null||r.jgSubject.flag===undefined){ if(r.jgSubject.flag===""||r.jgSubject.flag===null||r.jgSubject.flag===undefined){
vm.jgSubject.flag=0; vm.jgSubject.flag=0;
} }
...@@ -339,7 +368,23 @@ var vm = new Vue({ ...@@ -339,7 +368,23 @@ var vm = new Vue({
}, },
page:page page:page
}).trigger("reloadGrid"); }).trigger("reloadGrid");
},
handleExceed(files, fileList) {
this.$message.warning("文件数量超过了限制");
},
handleRemove(file, fileList) {
vm.fileList=fileList;
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
window.open("../file/"+file.name)
},
handleSuccess(response, file, fileList){
vm.fileList=fileList;
isUsedPhotoOrFile=true;
} }
} }
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment