Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
cf7ddc2b
提交
cf7ddc2b
authored
4月 16, 2020
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改session过期时间
上级
024d5074
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
191 行增加
和
85 行删除
+191
-85
TbCfArticleController.java
...n/java/com/platform/controller/TbCfArticleController.java
+14
-1
TbCfArticleDao.java
...-admin/src/main/java/com/platform/dao/TbCfArticleDao.java
+2
-0
TbCfArticleEntity.java
.../src/main/java/com/platform/entity/TbCfArticleEntity.java
+41
-19
TbCfArticleService.java
...rc/main/java/com/platform/service/TbCfArticleService.java
+4
-0
TbCfArticleServiceImpl.java
...ava/com/platform/service/impl/TbCfArticleServiceImpl.java
+5
-0
TbCfArticleDao.xml
...in/src/main/resources/com/platform/dao/TbCfArticleDao.xml
+16
-5
tbcfarticle.html
...m-admin/src/main/webapp/WEB-INF/page/sys/tbcfarticle.html
+15
-0
tbcfarticle.js
platform-admin/src/main/webapp/js/sys/tbcfarticle.js
+35
-2
platform-shiro.xml
platform-common/src/main/resources/platform-shiro.xml
+57
-56
TokenService.java
...tful/src/main/java/com/platform/service/TokenService.java
+2
-2
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfArticleController.java
浏览文件 @
cf7ddc2b
...
...
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -107,4 +108,16 @@ public class TbCfArticleController extends AbstractController {
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
(
"操作失败"
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfArticleDao.java
浏览文件 @
cf7ddc2b
package
com
.
platform
.
dao
;
import
com.platform.entity.TbCfArticleEntity
;
import
org.apache.ibatis.annotations.Param
;
/**
* 文章表Dao
...
...
@@ -10,4 +11,5 @@ import com.platform.entity.TbCfArticleEntity;
*/
public
interface
TbCfArticleDao
extends
BaseDao
<
TbCfArticleEntity
>
{
int
changeStatus
(
@Param
(
"isShow"
)
Integer
isShow
,
@Param
(
"ids"
)
String
ids
[]);
}
platform-admin/src/main/java/com/platform/entity/TbCfArticleEntity.java
浏览文件 @
cf7ddc2b
...
...
@@ -8,11 +8,13 @@ import java.util.Date;
* 表名 tb_cf_article
*
* @author lipengjun
* @date 2020-0
3-25 15:15:05
* @date 2020-0
4-15 10:58:12
*/
public
class
TbCfArticleEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
account
;
/**
* 文章ID
*/
...
...
@@ -46,9 +48,13 @@ public class TbCfArticleEntity implements Serializable {
*/
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 {
*/
private
Date
updatetime
;
private
String
account
;
public
String
getAccount
()
{
return
account
;
}
public
void
setAccount
(
String
account
)
{
this
.
account
=
account
;
}
/**
* 设置:文章ID
*/
...
...
@@ -81,6 +77,7 @@ public class TbCfArticleEntity implements Serializable {
public
String
getId
()
{
return
id
;
}
/**
* 设置:文章标题
*/
...
...
@@ -94,6 +91,7 @@ public class TbCfArticleEntity implements Serializable {
public
String
getTitle
()
{
return
title
;
}
/**
* 设置:文章内容
*/
...
...
@@ -107,6 +105,7 @@ public class TbCfArticleEntity implements Serializable {
public
String
getContent
()
{
return
content
;
}
/**
* 设置:图片
*/
...
...
@@ -120,6 +119,7 @@ public class TbCfArticleEntity implements Serializable {
public
String
getPicture
()
{
return
picture
;
}
/**
* 设置:系统用户:0 普通用户:1
*/
...
...
@@ -133,6 +133,7 @@ public class TbCfArticleEntity implements Serializable {
public
Integer
getAuthorType
()
{
return
authorType
;
}
/**
* 设置:作者
*/
...
...
@@ -146,6 +147,7 @@ public class TbCfArticleEntity implements Serializable {
public
String
getAuthor
()
{
return
author
;
}
/**
* 设置:点赞人数
*/
...
...
@@ -159,6 +161,7 @@ public class TbCfArticleEntity implements Serializable {
public
Long
getLikeNum
()
{
return
likeNum
;
}
/**
* 设置:删除标志 0:已删除 1:正常
*/
...
...
@@ -172,19 +175,29 @@ public class TbCfArticleEntity implements Serializable {
public
Integer
getDelFlag
()
{
return
delFlag
;
}
public
Integer
getTop
()
{
return
top
;
}
public
void
setTop
(
Integer
top
)
{
this
.
top
=
top
;
}
/**
* 设置:是否
置顶 是:Y 否:N
* 设置:是否
展示
*/
public
void
set
Top
(
String
top
)
{
this
.
top
=
top
;
public
void
set
IsShow
(
Integer
isShow
)
{
this
.
isShow
=
isShow
;
}
/**
* 获取:是否
置顶 是:Y 否:N
* 获取:是否
展示
*/
public
String
getTop
()
{
return
top
;
public
Integer
getIsShow
()
{
return
isShow
;
}
/**
* 设置:创建时间
*/
...
...
@@ -198,6 +211,7 @@ public class TbCfArticleEntity implements Serializable {
public
Date
getCreatetime
()
{
return
createtime
;
}
/**
* 设置:更新时间
*/
...
...
@@ -211,4 +225,12 @@ public class TbCfArticleEntity implements Serializable {
public
Date
getUpdatetime
()
{
return
updatetime
;
}
public
String
getAccount
()
{
return
account
;
}
public
void
setAccount
(
String
account
)
{
this
.
account
=
account
;
}
}
platform-admin/src/main/java/com/platform/service/TbCfArticleService.java
浏览文件 @
cf7ddc2b
package
com
.
platform
.
service
;
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.util.List
;
...
...
@@ -69,4 +71,6 @@ public interface TbCfArticleService {
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
int
changeStatus
(
Integer
isShow
,
String
ids
[]);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfArticleServiceImpl.java
浏览文件 @
cf7ddc2b
...
...
@@ -80,4 +80,9 @@ public class TbCfArticleServiceImpl implements TbCfArticleService {
public
int
deleteBatch
(
String
[]
ids
)
{
return
tbCfArticleDao
.
deleteBatch
(
ids
);
}
@Override
public
int
changeStatus
(
Integer
isShow
,
String
[]
ids
)
{
return
tbCfArticleDao
.
changeStatus
(
isShow
,
ids
);
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfArticleDao.xml
浏览文件 @
cf7ddc2b
...
...
@@ -13,6 +13,7 @@
<result
property=
"likeNum"
column=
"like_num"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"top"
column=
"top"
/>
<result
property=
"isShow"
column=
"is_show"
/>
<result
property=
"createtime"
column=
"createTime"
/>
<result
property=
"updatetime"
column=
"updateTime"
/>
</resultMap>
...
...
@@ -28,6 +29,7 @@
`like_num`,
`del_flag`,
`top`,
`is_show`,
`createTime`,
`updateTime`
from tb_cf_article
...
...
@@ -45,6 +47,7 @@
`like_num`,
`del_flag`,
`top`,
is_show,
`createTime`,
`updateTime`,
u.account account
...
...
@@ -59,7 +62,7 @@
order by ${sidx} ${order}
</when>
<otherwise>
order by createTime desc
order by
top desc,
createTime desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
...
...
@@ -86,6 +89,7 @@
`like_num`,
`del_flag`,
`top`,
`is_show`,
`createTime`,
`updateTime`)
values(
...
...
@@ -98,6 +102,7 @@
#{likeNum},
#{delFlag},
#{top},
#{isShow},
#{createtime},
#{updatetime})
</insert>
...
...
@@ -113,12 +118,18 @@
<if
test=
"likeNum != null"
>
`like_num` = #{likeNum},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</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=
"updatetime != null"
>
`updateTime` = #{updatetime}
</if>
</set>
where id = #{id}
</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 from tb_cf_article where id = #{value}
</delete>
...
...
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcfarticle.html
浏览文件 @
cf7ddc2b
...
...
@@ -25,6 +25,14 @@
#if($shiro.hasPermission("tbcfarticle:delete"))
<i-button
type=
"error"
@
click=
"del"
><i
class=
"fa fa-trash-o"
></i>
删除
</i-button>
#end
#if($shiro.hasPermission("tbcfarticle:changeStatus"))
<i-button
type=
"success"
@
click=
"changeStatus(1)"
><i
class=
"fa fa-arrow-up"
></i>
显示
</i-button>
#end
#if($shiro.hasPermission("tbcfarticle:changeStatus"))
<i-button
type=
"warning"
@
click=
"changeStatus(0)"
><i
class=
"fa fa-arrow-down"
></i>
隐藏
</i-button>
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
...
...
@@ -56,6 +64,13 @@
<i-input
v-model=
"tbCfArticle.author"
placeholder=
"260977204970 or ctehillah@gmail.com"
@
on-blur=
"queryAccount"
/>
</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"
>
<!-- <i-input v-model="xPicture.pictureUrl" placeholder="图片地址"/> -->
<upload
...
...
platform-admin/src/main/webapp/js/sys/tbcfarticle.js
浏览文件 @
cf7ddc2b
...
...
@@ -6,6 +6,7 @@ $(function () {
{
label
:
'文章标题'
,
name
:
'title'
,
index
:
'title'
,
width
:
80
},
{
label
:
'图片'
,
name
:
'picture'
,
index
:
'picture'
,
width
:
80
,
formatter
:
imageFormat
},
{
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
}
]
});
...
...
@@ -39,7 +40,9 @@ let vm = new Vue({
name
:
''
},
disabled
:
false
,
flag
:
true
flag
:
true
,
isShow
:
false
},
methods
:
{
...
...
@@ -74,6 +77,8 @@ let vm = new Vue({
vm
.
reload
();
},
add
:
function
()
{
vm
.
account
=
true
;
vm
.
isShow
=
false
;
vm
.
disabled
=
false
;
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
...
...
@@ -92,9 +97,34 @@ let vm = new Vue({
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
)
{
let
flag
=
this
.
queryAccount
();
let
flag
=
vm
.
flag
;
if
(
vm
.
tbCfArticle
.
authorType
===
1
&&
vm
.
tbCfArticle
.
id
==
null
)
{
flag
=
this
.
queryAccount
();
}
if
(
flag
)
{
if
(
!
vm
.
isShow
)
{
vm
.
tbCfArticle
.
isShow
=
0
;
}
else
{
vm
.
tbCfArticle
.
isShow
=
1
;
}
let
url
=
vm
.
tbCfArticle
.
id
==
null
?
"../tbcfarticle/save"
:
"../tbcfarticle/update"
;
vm
.
tbCfArticle
.
picture
=
this
.
uploadList
.
map
(
res
=>
res
).
join
(
','
);
vm
.
tbCfArticle
.
content
=
encodeURI
(
UE
.
getEditor
(
'content'
).
getContent
());
// 富文本取值
...
...
@@ -142,6 +172,9 @@ let vm = new Vue({
successCallback
:
function
(
r
)
{
vm
.
account
=
true
;
vm
.
tbCfArticle
=
r
.
tbCfArticle
;
if
(
vm
.
tbCfArticle
.
isShow
===
1
)
{
vm
.
isShow
=
true
;
}
let
content
=
vm
.
tbCfArticle
.
content
;
vm
.
uploadList
=
vm
.
tbCfArticle
.
picture
.
split
(
','
);
if
(
content
!=
null
)
{
...
...
platform-common/src/main/resources/platform-shiro.xml
浏览文件 @
cf7ddc2b
...
...
@@ -10,7 +10,7 @@
<bean
id=
"sessionManager"
class=
"org.apache.shiro.web.session.mgt.DefaultWebSessionManager"
>
<!-- 设置session过期时间为1小时(单位:毫秒),默认为30分钟 -->
<property
name=
"globalSessionTimeout"
value=
"864
00000"
></property>
<property
name=
"globalSessionTimeout"
value=
"25920
00000"
></property>
<property
name=
"sessionValidationSchedulerEnabled"
value=
"true"
></property>
<property
name=
"sessionIdUrlRewritingEnabled"
value=
"false"
></property>
</bean>
...
...
@@ -55,8 +55,9 @@
<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
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"
/>
...
...
platform-restful/src/main/java/com/platform/service/TokenService.java
浏览文件 @
cf7ddc2b
...
...
@@ -14,8 +14,8 @@ import java.util.Map;
public
class
TokenService
{
@Autowired
private
ApiTokenMapper
tokenDao
;
//1
2小时
后过期
private
final
static
int
EXPIRE
=
3600
*
12
;
//1
0天
后过期
private
final
static
int
EXPIRE
=
3600
*
240
;
public
TokenEntity
queryByUserId
(
Long
userId
)
{
return
tokenDao
.
queryByUserId
(
userId
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论