提交 cf7ddc2b authored 作者: zgy's avatar zgy

修改session过期时间

上级 024d5074
...@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseBody;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -25,7 +26,7 @@ import java.util.Map; ...@@ -25,7 +26,7 @@ import java.util.Map;
*/ */
@Controller @Controller
@RequestMapping("tbcfarticle") @RequestMapping("tbcfarticle")
public class TbCfArticleController extends AbstractController { public class TbCfArticleController extends AbstractController {
@Autowired @Autowired
private TbCfArticleService tbCfArticleService; private TbCfArticleService tbCfArticleService;
...@@ -107,4 +108,16 @@ public class TbCfArticleController extends AbstractController { ...@@ -107,4 +108,16 @@ public class TbCfArticleController extends AbstractController {
return R.ok().put("list", list); return R.ok().put("list", list);
} }
@RequestMapping("/changeStatus")
@ResponseBody
@RequiresPermissions("tbcfarticle:changeStatus")
public R changeStatus(@RequestParam("isShow") Integer isShow, @RequestBody String ids[]) {
int res = tbCfArticleService.changeStatus(isShow, ids);
if (res>0){
return R.ok();
}
return R.error("操作失败");
}
} }
package com.platform.dao; package com.platform.dao;
import com.platform.entity.TbCfArticleEntity; import com.platform.entity.TbCfArticleEntity;
import org.apache.ibatis.annotations.Param;
/** /**
* 文章表Dao * 文章表Dao
...@@ -10,4 +11,5 @@ import com.platform.entity.TbCfArticleEntity; ...@@ -10,4 +11,5 @@ import com.platform.entity.TbCfArticleEntity;
*/ */
public interface TbCfArticleDao extends BaseDao<TbCfArticleEntity> { public interface TbCfArticleDao extends BaseDao<TbCfArticleEntity> {
int changeStatus(@Param("isShow") Integer isShow, @Param("ids") String ids[]);
} }
...@@ -8,11 +8,13 @@ import java.util.Date; ...@@ -8,11 +8,13 @@ import java.util.Date;
* 表名 tb_cf_article * 表名 tb_cf_article
* *
* @author lipengjun * @author lipengjun
* @date 2020-03-25 15:15:05 * @date 2020-04-15 10:58:12
*/ */
public class TbCfArticleEntity implements Serializable { public class TbCfArticleEntity implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private String account;
/** /**
* 文章ID * 文章ID
*/ */
...@@ -46,9 +48,13 @@ public class TbCfArticleEntity implements Serializable { ...@@ -46,9 +48,13 @@ public class TbCfArticleEntity implements Serializable {
*/ */
private Integer delFlag; private Integer delFlag;
/** /**
* 是否置顶 是:Y 否:N * 是否置顶 0:否 1:置顶
*/ */
private String top; private Integer top;
/**
* 是否展示
*/
private Integer isShow;
/** /**
* 创建时间 * 创建时间
*/ */
...@@ -58,16 +64,6 @@ public class TbCfArticleEntity implements Serializable { ...@@ -58,16 +64,6 @@ public class TbCfArticleEntity implements Serializable {
*/ */
private Date updatetime; private Date updatetime;
private String account;
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
/** /**
* 设置:文章ID * 设置:文章ID
*/ */
...@@ -81,6 +77,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -81,6 +77,7 @@ public class TbCfArticleEntity implements Serializable {
public String getId() { public String getId() {
return id; return id;
} }
/** /**
* 设置:文章标题 * 设置:文章标题
*/ */
...@@ -94,6 +91,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -94,6 +91,7 @@ public class TbCfArticleEntity implements Serializable {
public String getTitle() { public String getTitle() {
return title; return title;
} }
/** /**
* 设置:文章内容 * 设置:文章内容
*/ */
...@@ -107,6 +105,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -107,6 +105,7 @@ public class TbCfArticleEntity implements Serializable {
public String getContent() { public String getContent() {
return content; return content;
} }
/** /**
* 设置:图片 * 设置:图片
*/ */
...@@ -120,6 +119,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -120,6 +119,7 @@ public class TbCfArticleEntity implements Serializable {
public String getPicture() { public String getPicture() {
return picture; return picture;
} }
/** /**
* 设置:系统用户:0 普通用户:1 * 设置:系统用户:0 普通用户:1
*/ */
...@@ -133,6 +133,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -133,6 +133,7 @@ public class TbCfArticleEntity implements Serializable {
public Integer getAuthorType() { public Integer getAuthorType() {
return authorType; return authorType;
} }
/** /**
* 设置:作者 * 设置:作者
*/ */
...@@ -146,6 +147,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -146,6 +147,7 @@ public class TbCfArticleEntity implements Serializable {
public String getAuthor() { public String getAuthor() {
return author; return author;
} }
/** /**
* 设置:点赞人数 * 设置:点赞人数
*/ */
...@@ -159,6 +161,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -159,6 +161,7 @@ public class TbCfArticleEntity implements Serializable {
public Long getLikeNum() { public Long getLikeNum() {
return likeNum; return likeNum;
} }
/** /**
* 设置:删除标志 0:已删除 1:正常 * 设置:删除标志 0:已删除 1:正常
*/ */
...@@ -172,19 +175,29 @@ public class TbCfArticleEntity implements Serializable { ...@@ -172,19 +175,29 @@ public class TbCfArticleEntity implements Serializable {
public Integer getDelFlag() { public Integer getDelFlag() {
return delFlag; return delFlag;
} }
public Integer getTop() {
return top;
}
public void setTop(Integer top) {
this.top = top;
}
/** /**
* 设置:是否置顶 是:Y 否:N * 设置:是否展示
*/ */
public void setTop(String top) { public void setIsShow(Integer isShow) {
this.top = top; this.isShow = isShow;
} }
/** /**
* 获取:是否置顶 是:Y 否:N * 获取:是否展示
*/ */
public String getTop() { public Integer getIsShow() {
return top; return isShow;
} }
/** /**
* 设置:创建时间 * 设置:创建时间
*/ */
...@@ -198,6 +211,7 @@ public class TbCfArticleEntity implements Serializable { ...@@ -198,6 +211,7 @@ public class TbCfArticleEntity implements Serializable {
public Date getCreatetime() { public Date getCreatetime() {
return createtime; return createtime;
} }
/** /**
* 设置:更新时间 * 设置:更新时间
*/ */
...@@ -211,4 +225,12 @@ public class TbCfArticleEntity implements Serializable { ...@@ -211,4 +225,12 @@ public class TbCfArticleEntity implements Serializable {
public Date getUpdatetime() { public Date getUpdatetime() {
return updatetime; return updatetime;
} }
public String getAccount() {
return account;
}
public void setAccount(String account) {
this.account = account;
}
} }
package com.platform.service; package com.platform.service;
import com.platform.entity.TbCfArticleEntity; import com.platform.entity.TbCfArticleEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.List; import java.util.List;
...@@ -69,4 +71,6 @@ public interface TbCfArticleService { ...@@ -69,4 +71,6 @@ public interface TbCfArticleService {
* @return 删除条数 * @return 删除条数
*/ */
int deleteBatch(String[] ids); int deleteBatch(String[] ids);
int changeStatus(Integer isShow, String ids[]);
} }
...@@ -80,4 +80,9 @@ public class TbCfArticleServiceImpl implements TbCfArticleService { ...@@ -80,4 +80,9 @@ public class TbCfArticleServiceImpl implements TbCfArticleService {
public int deleteBatch(String[] ids) { public int deleteBatch(String[] ids) {
return tbCfArticleDao.deleteBatch(ids); return tbCfArticleDao.deleteBatch(ids);
} }
@Override
public int changeStatus(Integer isShow, String[] ids) {
return tbCfArticleDao.changeStatus(isShow, ids);
}
} }
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<result property="likeNum" column="like_num"/> <result property="likeNum" column="like_num"/>
<result property="delFlag" column="del_flag"/> <result property="delFlag" column="del_flag"/>
<result property="top" column="top"/> <result property="top" column="top"/>
<result property="isShow" column="is_show"/>
<result property="createtime" column="createTime"/> <result property="createtime" column="createTime"/>
<result property="updatetime" column="updateTime"/> <result property="updatetime" column="updateTime"/>
</resultMap> </resultMap>
...@@ -28,6 +29,7 @@ ...@@ -28,6 +29,7 @@
`like_num`, `like_num`,
`del_flag`, `del_flag`,
`top`, `top`,
`is_show`,
`createTime`, `createTime`,
`updateTime` `updateTime`
from tb_cf_article from tb_cf_article
...@@ -45,6 +47,7 @@ ...@@ -45,6 +47,7 @@
`like_num`, `like_num`,
`del_flag`, `del_flag`,
`top`, `top`,
is_show,
`createTime`, `createTime`,
`updateTime`, `updateTime`,
u.account account u.account account
...@@ -59,7 +62,7 @@ ...@@ -59,7 +62,7 @@
order by ${sidx} ${order} order by ${sidx} ${order}
</when> </when>
<otherwise> <otherwise>
order by createTime desc order by top desc,createTime desc
</otherwise> </otherwise>
</choose> </choose>
<if test="offset != null and limit != null"> <if test="offset != null and limit != null">
...@@ -70,9 +73,9 @@ ...@@ -70,9 +73,9 @@
<select id="queryTotal" resultType="int"> <select id="queryTotal" resultType="int">
select count(*) from tb_cf_article select count(*) from tb_cf_article
WHERE 1=1 WHERE 1=1
<if test="name != null and name.trim() != ''"> <if test="name != null and name.trim() != ''">
AND title LIKE concat('%',#{name},'%') AND title LIKE concat('%',#{name},'%')
</if> </if>
</select> </select>
<insert id="save" parameterType="com.platform.entity.TbCfArticleEntity"> <insert id="save" parameterType="com.platform.entity.TbCfArticleEntity">
...@@ -86,6 +89,7 @@ ...@@ -86,6 +89,7 @@
`like_num`, `like_num`,
`del_flag`, `del_flag`,
`top`, `top`,
`is_show`,
`createTime`, `createTime`,
`updateTime`) `updateTime`)
values( values(
...@@ -98,6 +102,7 @@ ...@@ -98,6 +102,7 @@
#{likeNum}, #{likeNum},
#{delFlag}, #{delFlag},
#{top}, #{top},
#{isShow},
#{createtime}, #{createtime},
#{updatetime}) #{updatetime})
</insert> </insert>
...@@ -113,12 +118,18 @@ ...@@ -113,12 +118,18 @@
<if test="likeNum != null">`like_num` = #{likeNum},</if> <if test="likeNum != null">`like_num` = #{likeNum},</if>
<if test="delFlag != null">`del_flag` = #{delFlag},</if> <if test="delFlag != null">`del_flag` = #{delFlag},</if>
<if test="top != null">`top` = #{top},</if> <if test="top != null">`top` = #{top},</if>
<if test="isShow != null">`is_show` = #{isShow},</if>
<if test="createtime != null">`createTime` = #{createtime},</if> <if test="createtime != null">`createTime` = #{createtime},</if>
<if test="updatetime != null">`updateTime` = #{updatetime}</if> <if test="updatetime != null">`updateTime` = #{updatetime}</if>
</set> </set>
where id = #{id} where id = #{id}
</update> </update>
<update id="changeStatus">
update tb_cf_article set is_show=#{isShow} where id in
<foreach item="id" collection="ids" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<delete id="delete"> <delete id="delete">
delete from tb_cf_article where id = #{value} delete from tb_cf_article where id = #{value}
</delete> </delete>
......
...@@ -25,6 +25,14 @@ ...@@ -25,6 +25,14 @@
#if($shiro.hasPermission("tbcfarticle:delete")) #if($shiro.hasPermission("tbcfarticle:delete"))
<i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button> <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
#end #end
#if($shiro.hasPermission("tbcfarticle:changeStatus"))
<i-button type="success" @click="changeStatus(1)"><i class="fa fa-arrow-up"></i>&nbsp;显示
</i-button>
#end
#if($shiro.hasPermission("tbcfarticle:changeStatus"))
<i-button type="warning" @click="changeStatus(0)"><i class="fa fa-arrow-down"></i>&nbsp;隐藏
</i-button>
#end
</div> </div>
</Row> </Row>
<table id="jqGrid"></table> <table id="jqGrid"></table>
...@@ -56,6 +64,13 @@ ...@@ -56,6 +64,13 @@
<i-input v-model="tbCfArticle.author" placeholder="260977204970 or ctehillah@gmail.com" <i-input v-model="tbCfArticle.author" placeholder="260977204970 or ctehillah@gmail.com"
@on-blur="queryAccount"/> @on-blur="queryAccount"/>
</Form-item> </Form-item>
<Form-item label="是否显示" prop="isShow">
<i-Switch size="large" v-model="isShow" true-color="#13ce66" false-color="#eeddff"
>
<span slot="open">显示</span>
<span slot="close">隐藏</span>
</i-Switch>
</Form-item>
<Form-item label="图片" prop="picture"> <Form-item label="图片" prop="picture">
<!-- <i-input v-model="xPicture.pictureUrl" placeholder="图片地址"/> --> <!-- <i-input v-model="xPicture.pictureUrl" placeholder="图片地址"/> -->
<upload <upload
......
...@@ -6,6 +6,7 @@ $(function () { ...@@ -6,6 +6,7 @@ $(function () {
{label: '文章标题', name: 'title', index: 'title', width: 80}, {label: '文章标题', name: 'title', index: 'title', width: 80},
{label: '图片', name: 'picture', index: 'picture', width: 80, formatter: imageFormat}, {label: '图片', name: 'picture', index: 'picture', width: 80, formatter: imageFormat},
{label: '作者', name: 'account', index: 'account', width: 80, formatter: accountFormat}, {label: '作者', name: 'account', index: 'account', width: 80, formatter: accountFormat},
{label: '是否显示', name: 'isShow', index: 'isShow', width: 80, formatter: validFormat},
{label: '创建时间', name: 'createtime', index: 'createTime', width: 80} {label: '创建时间', name: 'createtime', index: 'createTime', width: 80}
] ]
}); });
...@@ -39,7 +40,9 @@ let vm = new Vue({ ...@@ -39,7 +40,9 @@ let vm = new Vue({
name: '' name: ''
}, },
disabled: false, disabled: false,
flag: true flag: true,
isShow: false
}, },
methods: { methods: {
...@@ -74,6 +77,8 @@ let vm = new Vue({ ...@@ -74,6 +77,8 @@ let vm = new Vue({
vm.reload(); vm.reload();
}, },
add: function () { add: function () {
vm.account = true;
vm.isShow = false;
vm.disabled = false; vm.disabled = false;
vm.showList = false; vm.showList = false;
vm.title = "新增"; vm.title = "新增";
...@@ -92,9 +97,34 @@ let vm = new Vue({ ...@@ -92,9 +97,34 @@ let vm = new Vue({
vm.getInfo(id); vm.getInfo(id);
}, },
changeStatus: function (status) {
let Ids = getSelectedRows("#jqGrid");
if (Ids == null) {
return;
}
Ajax.request({
url: "../tbcfarticle/changeStatus?isShow=" + status,
params: JSON.stringify(Ids),
type: "POST",
contentType: "application/json",
successCallback: function () {
alert('操作成功', function (index) {
vm.reload();
});
}
});
},
saveOrUpdate: function (event) { saveOrUpdate: function (event) {
let flag = this.queryAccount(); let flag = vm.flag;
if (vm.tbCfArticle.authorType === 1 && vm.tbCfArticle.id == null) {
flag = this.queryAccount();
}
if (flag) { if (flag) {
if (!vm.isShow) {
vm.tbCfArticle.isShow = 0;
} else {
vm.tbCfArticle.isShow = 1;
}
let url = vm.tbCfArticle.id == null ? "../tbcfarticle/save" : "../tbcfarticle/update"; let url = vm.tbCfArticle.id == null ? "../tbcfarticle/save" : "../tbcfarticle/update";
vm.tbCfArticle.picture = this.uploadList.map(res => res).join(','); vm.tbCfArticle.picture = this.uploadList.map(res => res).join(',');
vm.tbCfArticle.content = encodeURI(UE.getEditor('content').getContent()); // 富文本取值 vm.tbCfArticle.content = encodeURI(UE.getEditor('content').getContent()); // 富文本取值
...@@ -142,6 +172,9 @@ let vm = new Vue({ ...@@ -142,6 +172,9 @@ let vm = new Vue({
successCallback: function (r) { successCallback: function (r) {
vm.account = true; vm.account = true;
vm.tbCfArticle = r.tbCfArticle; vm.tbCfArticle = r.tbCfArticle;
if (vm.tbCfArticle.isShow === 1) {
vm.isShow = true;
}
let content = vm.tbCfArticle.content; let content = vm.tbCfArticle.content;
vm.uploadList = vm.tbCfArticle.picture.split(','); vm.uploadList = vm.tbCfArticle.picture.split(',');
if (content != null) { if (content != null) {
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans" <beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=" xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.2.xsd"> http://www.springframework.org/schema/beans/spring-beans-4.2.xsd">
<!-- 继承自AuthorizingRealm的自定义Realm,即指定Shiro验证用户登录的类为自定义的UserRealm.java --> <!-- 继承自AuthorizingRealm的自定义Realm,即指定Shiro验证用户登录的类为自定义的UserRealm.java -->
<bean id="userRealm" class="com.platform.shiro.UserRealm"/> <bean id="userRealm" class="com.platform.shiro.UserRealm"/>
<bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager"> <bean id="sessionManager" class="org.apache.shiro.web.session.mgt.DefaultWebSessionManager">
<!-- 设置session过期时间为1小时(单位:毫秒),默认为30分钟 --> <!-- 设置session过期时间为1小时(单位:毫秒),默认为30分钟 -->
<property name="globalSessionTimeout" value="86400000"></property> <property name="globalSessionTimeout" value="2592000000"></property>
<property name="sessionValidationSchedulerEnabled" value="true"></property> <property name="sessionValidationSchedulerEnabled" value="true"></property>
<property name="sessionIdUrlRewritingEnabled" value="false"></property> <property name="sessionIdUrlRewritingEnabled" value="false"></property>
</bean> </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路径表达式的、自定义的过滤器的执行 --> <!-- Shiro默认会使用Servlet容器的Session,可通过sessionMode属性来指定使用Shiro原生Session -->
<!-- Web应用中,Shiro可控制的Web请求必须经过Shiro主过滤器的拦截,Shiro对基于Spring的Web应用提供了完美的支持 --> <!-- 即<property name="sessionMode" value="native"/>,详细说明见官方文档 -->
<bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <!-- 这里主要是设置自定义的单Realm应用,若有多个Realm,可使用'realms'属性代替 -->
<!-- Shiro的核心安全接口,这个属性是必须的 --> <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager">
<property name="securityManager" ref="securityManager"/> <property name="sessionManager" ref="sessionManager"></property>
<!-- 要求登录时的链接(可根据项目的URL进行替换),非必须的属性,默认会自动寻找Web工程根目录下的"/login.html"页面 --> <property name="realm" ref="userRealm"/>
<property name="loginUrl" value="/login.html"/> </bean>
<!-- 登录成功后要跳转的连接 -->
<property name="successUrl" value="/index.html"/> <!-- Shiro主过滤器本身功能十分强大,其强大之处就在于它支持任何基于URL路径表达式的、自定义的过滤器的执行 -->
<!-- 用户访问未对其授权的资源时,所显示的连接 --> <!-- Web应用中,Shiro可控制的Web请求必须经过Shiro主过滤器的拦截,Shiro对基于Spring的Web应用提供了完美的支持 -->
<!-- 若想更明显的测试此属性可以修改它的值,如unauthor.jsp,登录后访问/admin/listUser.jsp就看见浏览器会显示unauthor.jsp --> <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean">
<property name="unauthorizedUrl" value="/"/> <!-- Shiro的核心安全接口,这个属性是必须的 -->
<!-- Shiro连接约束配置,即过滤链的定义 --> <property name="securityManager" ref="securityManager"/>
<!-- 此处可配合我的这篇文章来理解各个过滤连的作用http://blog.csdn.net/jadyer/article/details/12172839 --> <!-- 要求登录时的链接(可根据项目的URL进行替换),非必须的属性,默认会自动寻找Web工程根目录下的"/login.html"页面 -->
<!-- 下面value值的第一个'/'代表的路径是相对于HttpServletRequest.getContextPath()的值来的 --> <property name="loginUrl" value="/login.html"/>
<!-- anon:它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种 --> <!-- 登录成功后要跳转的连接 -->
<!-- authc:该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter --> <property name="successUrl" value="/index.html"/>
<property name="filterChainDefinitions"> <!-- 用户访问未对其授权的资源时,所显示的连接 -->
<value> <!-- 若想更明显的测试此属性可以修改它的值,如unauthor.jsp,登录后访问/admin/listUser.jsp就看见浏览器会显示unauthor.jsp -->
/statics/**=anon <property name="unauthorizedUrl" value="/"/>
/api/**=anon <!-- Shiro连接约束配置,即过滤链的定义 -->
/login.html=anon <!-- 此处可配合我的这篇文章来理解各个过滤连的作用http://blog.csdn.net/jadyer/article/details/12172839 -->
/sys/login=anon <!-- 下面value值的第一个'/'代表的路径是相对于HttpServletRequest.getContextPath()的值来的 -->
/captcha.jpg=anon <!-- anon:它对应的过滤器里面是空的,什么都没做,这里.do和.jsp后面的*表示参数,比方说login.jsp?main这种 -->
/**=authc <!-- authc:该过滤器下的页面必须验证后才能访问,它是Shiro内置的一个拦截器org.apache.shiro.web.filter.authc.FormAuthenticationFilter -->
</value> <property name="filterChainDefinitions">
</property> <value>
</bean> /statics/**=anon
/api/**=anon
<bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/> /login.html=anon
/sys/login=anon
<!-- AOP式方法级权限检查 --> /captcha.jpg=anon
<bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" depends-on="lifecycleBeanPostProcessor"> /**=authc
<property name="proxyTargetClass" value="true" /> </value>
</bean> </property>
<bean class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor"> </bean>
<property name="securityManager" ref="securityManager"/>
</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> </beans>
\ No newline at end of file
...@@ -14,8 +14,8 @@ import java.util.Map; ...@@ -14,8 +14,8 @@ import java.util.Map;
public class TokenService { public class TokenService {
@Autowired @Autowired
private ApiTokenMapper tokenDao; private ApiTokenMapper tokenDao;
//12小时后过期 //10天后过期
private final static int EXPIRE = 3600 * 12; private final static int EXPIRE = 3600 * 240;
public TokenEntity queryByUserId(Long userId) { public TokenEntity queryByUserId(Long userId) {
return tokenDao.queryByUserId(userId); return tokenDao.queryByUserId(userId);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论