Skip to content

Commit

Permalink
jfinal cms v4.2.0 release~!~
Browse files Browse the repository at this point in the history
  • Loading branch information
FLY的狐狸 committed Jan 26, 2017
1 parent 52df620 commit 2d99b92
Show file tree
Hide file tree
Showing 181 changed files with 28,574 additions and 108 deletions.
13 changes: 13 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
Change Log 更新说明
------------------------------

## 2017-01-22 jfinal cms4.2.0
> 1. 优化论坛模板数据
> 2. 模板发布功能优化
## 2017-01-20
> 1. 加入论坛模板
## 2017-01-07
> 1. 完善博客样式
> 2. 加入参数配置菜单更新sql
> 3. 完善权限细节
## 2017-01-01 jfinal cms4.1.5
> 1. 后台加入新的主题flat。
Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,9 @@ jfinal cms
2. [beetl](http://ibeetl.com/community/)
3. [oschina](http://www.oschina.net/)

开源赞助
# support
------------------------

* 支付宝支付
![jflyfox](http://blog.jflyfox.com/static/images/common/pay_weixin.jpg "Open source support(alipay)")

![jflyfox](http://ww1.sinaimg.cn/mw690/3fc7e281jw1eqec436tzwj2074074mxr.jpg "Open source support(alipay)")

* 微信支付

![jflyfox](http://ww1.sinaimg.cn/mw690/3fc7e281jw1es3jr0k25xj20a50a5q3v.jpg "Open source support(weixin)")
![jflyfox](http://blog.jflyfox.com/static/images/common/pay_alipay.jpg "Open source support(weixin)")
12 changes: 8 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.jflyfox</groupId>
<artifactId>jfinal_cms</artifactId>
<packaging>war</packaging>
<version>4.1.5</version>
<version>4.2.0</version>

<properties>
<!-- 文件拷贝时的编码 -->
Expand Down Expand Up @@ -32,6 +32,10 @@
<groupId>com.jflyfox</groupId>
<artifactId>jflyfox_base</artifactId>
</exclusion>
<exclusion>
<groupId>org.beetl</groupId>
<artifactId>beetl-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -99,9 +103,9 @@
</exclusions>
</dependency>
<dependency>
<groupId>org.beetl</groupId>
<artifactId>beetl-core</artifactId>
<version>2.0.12</version>
<groupId>com.ibeetl</groupId>
<artifactId>beetl</artifactId>
<version>2.7.5</version>
<exclusions>
<exclusion>
<groupId>org.apache.commons</groupId>
Expand Down
130 changes: 85 additions & 45 deletions sql/jfinal_cms_v4.sql

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion sql/update/20161231_站点字段完善.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ INSERT INTO `sys_config` VALUES ('11', '站点根目录', 'SITE.TEMPLATE.PATH',
INSERT INTO `sys_config` VALUES ('12', 'Session站点列表', 'SITE.SESSION.SITES', 'sites', null, '9', '213', '2016-12-31 16:30:17', '1', '2016-12-31 16:30:17', '1');
INSERT INTO `sys_config` VALUES ('13', 'Session站点', 'SITE.SESSION.SITE', 'site', null, '9', '214', '2016-12-31 16:30:38', '1', '2016-12-31 16:30:38', '1');

update tb_site set site_defalut = 1 where id = 5;
update tb_site set site_defalut = 1 where id = 5;

INSERT INTO `sys_menu` VALUES ('31', '1', '参数配置', 'config', 'system/config', '1', '1', '97', '2', '2016-12-17 23:34:13', '1');
39 changes: 39 additions & 0 deletions sql/update/20170113_bbs测试数据.sql

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/main/java/com/baidu/ueditor/hunter/FileManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ private State getState ( Object[] files ) {
private String getPath ( File file ) {

String path = file.getAbsolutePath();

return path.replace( this.rootPath, "/" );
path = PathFormat.format(path);
path = path.replace( this.rootPath, "/" );
path = path.replace( "//", "/" );
return path;

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,5 +242,18 @@ public Controller removeSessionAttrCache(String key) {
cache.remove(key + "_" + id);
return this;
}

/**
* 是否是管理员
*
* 2017年1月21日 下午11:55:16
* flyfox [email protected]
* @param user
* @return
*/
@SuppressWarnings("rawtypes")
public boolean isAdmin(SessionUser user){
return user.getInt("usertype") == 1;
}

}
2 changes: 2 additions & 0 deletions src/main/java/com/jflyfox/component/config/BaseConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ public void configInterceptor(Interceptors me) {
*/
@Override
public void afterJFinalStart() {
// super.afterJFinalStart();

JFlyFoxCache.init();
System.out.println("##################################");
System.out.println("############系统启动完成##########");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,11 @@ public void list_approve() {
sql.whereEquals("folder_id", model.getInt("folder_id"));
sql.whereEquals("status", model.getInt("status"));

// 站点设置
sql.whereEquals("site_id", getSessionSite().getBackSiteId());
}

// 站点设置
int siteId = getSessionSite().getBackSiteId();
sql.append(" and site_id = " + siteId);

// 排序
String orderBy = getBaseForm().getOrderBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import java.util.List;

import com.jfinal.plugin.activerecord.Db;
import com.jflyfox.component.util.JFlyFoxUtils;
import com.jflyfox.jfinal.base.BaseService;
import com.jflyfox.modules.admin.article.TbArticle;
import com.jflyfox.modules.front.service.FrontCacheService;
import com.jflyfox.system.user.SysUser;
import com.jflyfox.util.DateUtils;
import com.jflyfox.util.cache.Cache;
import com.jflyfox.util.cache.CacheManager;
import com.jflyfox.util.extend.HtmlUtils;

public class CommentService extends BaseService {

Expand Down Expand Up @@ -40,8 +40,9 @@ public void clearCache() {
public void saveComment(SysUser user, TbComment comment) {
// 评论
// 删除标签
String content = HtmlUtils.delHTMLTag(comment.getStr("content"));
content = HtmlUtils.changeTag(content);
// String content = HtmlUtils.delHTMLTag(comment.getStr("content"));
// content = HtmlUtils.changeTag(content);
String content = JFlyFoxUtils.delScriptTag(comment.getStr("content"));

comment.put("content", content);
// 评论
Expand All @@ -57,7 +58,7 @@ public void saveComment(SysUser user, TbComment comment) {
}
comment.put("status", status);

comment.put("fatherId", 0);
// comment.put("fatherId", 0);
comment.put("create_id", user.getUserID());
comment.put("create_time", DateUtils.getNow(DateUtils.DEFAULT_REGEX_YYYY_MM_DD_HH_MIN_SS));
comment.save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public void index() {
Page<TbArticle> articlePage = TbArticle.dao.paginate(new Paginator(1, 10), "select t.*,f.name as folderName " //
, " from tb_article t left join tb_folder f on f.id = t.folder_id " //
+ " where t.status = 1 and t.type in (11,12) " // 查询状态为显示,类型是预览和正常的文章
+" and f.site_id="+getSessionSite().getBackSiteId()
+ " order by t.update_time desc,t.id desc");
setAttr("articles", articlePage.getList());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,12 @@ public void index() {
setAttr("taglist", taglist);

// 评论
Page<TbComment> comments = TbComment.dao.paginate(getPaginator(), "select * ", //
" from tb_comment where article_id = ? order by create_time desc ", articleId);
String sql = " from tb_comment t" //
+ " left join tb_article art on art.id = t.article_id " //
+ " where article_id = ? order by create_time desc ";
Page<TbComment> comments = TbComment.dao.paginate(getPaginator() //
, "select t.*,art.title,art.create_id as article_create_id ", sql, articleId);

setAttr("page", comments);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import com.jflyfox.jfinal.base.Paginator;
import com.jflyfox.jfinal.component.annotation.ControllerBind;
import com.jflyfox.modules.CommonController;
import com.jflyfox.modules.admin.article.ArticleConstant;
import com.jflyfox.modules.admin.article.TbArticle;
import com.jflyfox.modules.admin.comment.CommentService;
import com.jflyfox.modules.admin.tags.TbTags;
Expand Down Expand Up @@ -270,15 +271,26 @@ public void saveblog() {

model.setUpdateTime(getNow());
if (pid != null && pid > 0) { // 更新
// 管理员或者自己才能修改
if (isAdmin(user) //
|| model.getCreateId().intValue() == user.getUserID().intValue()) {
json.put("msg", "你没有权限修改博文!");
renderJson(json.toJSONString());
return;
}

model.update();
} else { // 新增
model.remove("id");
model.setFolderId(JFlyFoxUtils.MENU_BLOG); // 博文目录
if (model.getFolderId() == null || model.getFolderId() <= 0) {
model.setFolderId(JFlyFoxUtils.MENU_BLOG); // 博文目录
}
model.setStatus("1"); // 显示
model.setType(11);
model.setIsComment(1); // 能评论
model.setIsRecommend(2);// 不推荐
model.setSort(20); // 排序
model.set("approve_status", ArticleConstant.APPROVE_STATUS_PASS); // 需要审核改为update
model.setPublishTime(DateUtils.getNow("yyyy-MM-dd")); // 发布时间
model.setPublishUser(user.getUserName()); // 发布人
model.setCreateId(getSessionUser().getUserID());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@
public class FrontCacheService extends BaseService {

private final static String cacheName = "FrontCacheService";
/**
* 目录缓存
*/
private static Cache cache = CacheManager.get(cacheName);

private final static Cache cache = CacheManager.get(cacheName);
/**
* 更新缓存,清空
*
Expand Down Expand Up @@ -179,6 +175,35 @@ public Page<TbArticle> getArticleBySiteId(Paginator paginator, int siteId) {
return articles;
}

/**
* 返回对应文章列表
*
* 2015年5月24日 下午10:52:05 flyfox [email protected]
*
* @param paginator
* @param folderId
* @return
*/
public Page<TbArticle> getArticleByOrder(Paginator paginator, int siteId, int orderType) {
String key = ("articleOrder_" + paginator.getPageNo() + "_" + paginator.getPageSize() + "_" + siteId + "_" + orderType);
String fromSql = " from tb_article t " //
+ " left join tb_folder tf on tf.id = t.folder_id " //
+ " where " + getPublicWhere() //
+ " and tf.site_id = ? ";
if (orderType==1) { // 默认
fromSql +=" order by t.sort,t.create_time desc";
} else if (orderType==2){ // 最新
fromSql +=" order by t.create_time desc";
} else if (orderType==3){ // 精品
fromSql +=" order by (t.count_comment*10+t.count_view) desc";
} else if (orderType==4){ // 待回复的
fromSql +=" and t.count_comment = 0 order by t.create_time desc";
}
// 推荐文章列表
Page<TbArticle> articles = TbArticle.dao.paginateCache(cacheName, key, paginator, "select t.* ", fromSql, siteId);
return articles;
}

/**
* 返回对应文章列表
*
Expand Down Expand Up @@ -278,4 +303,4 @@ public String getPublicWhere() {
+ " and t.type in (11,12) " // 查询状态为显示,类型是预览和正常的文章
;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,21 @@ public Page<TbArticle> articlePageTop(int pageNo, int pageSize, int siteId) {
public Page<TbArticle> articlePageSite(int pageNo, int pageSize, int siteId) {
return service.getArticleBySiteId(new Paginator(pageNo, pageSize), siteId);
}

/**
* 按照特定排序,返回文章列表
*
* 2017年1月17日 下午5:37:16
* flyfox [email protected]
* @param pageNo
* @param pageSize
* @param siteId
* @param orderType
* @return
*/
public Page<TbArticle> articleOrder(int pageNo, int pageSize, int siteId, int orderType) {
return service.getArticleByOrder(new Paginator(pageNo, pageSize), siteId, orderType);
}

/**
* 返回文章列表
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/jflyfox/system/user/UserInterceptor.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ public void intercept(Invocation ai) {
*/
protected boolean urlAuth(Controller controller, String tmpPath) {
List<SysMenu> list = controller.getSessionAttr("nomenu");
// nomenuList 应该是size等于0,而不是空
if (list == null) {
return false;
}

for (SysMenu sysMenu : list) {
String url = sysMenu.getStr("url");
if (StrUtils.isEmpty(url)) {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 2 additions & 6 deletions src/main/webapp/pages/admin/comment/comment_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,8 @@
</td>
<td>${flyfox.getUserName(item.create_id)}</td>
<td>${flyfox.getUserName(item.reply_userid)}</td>
<td title="${item.content}">
<% if (strutil.length(item.content) > 20) { %>
${strutil.subStringTo(item.content, 0, 20)}...
<% } else {%>
${item.content }
<% } %>
<td title="${flyfox.showHTML(item.content, 200, '...')}">
${flyfox.showHTML(item.content, 30, '...')}
</td>
<td>
<% if(item.status==11) { %>
Expand Down
8 changes: 2 additions & 6 deletions src/main/webapp/pages/admin/home/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,8 @@ <h3 class="panel-title">回复TOP10&nbsp;&nbsp;<a href="admin/comment/list" styl
</td>
<td>${flyfox.getUserName(item.create_id)}</td>
<td>${flyfox.getUserName(item.reply_userid)}</td>
<td title="${item.content}">
<% if (strutil.length(item.content) > 20) { %>
${strutil.subStringTo(item.content, 0, 20)}...
<% } else {%>
${item.content }
<% } %>
<td title="${flyfox.showHTML(item.content, 200, '...')}">
${flyfox.showHTML(item.content, 30, '...')}
</td>
</tr>
<% } %>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2d99b92

Please sign in to comment.