Commit 818f5552 authored by sgjj's avatar sgjj

更新

parent 0fd4a57a
...@@ -3,10 +3,9 @@ ...@@ -3,10 +3,9 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>mcms</artifactId> <artifactId>mcms</artifactId>
<version>4.7.0-SNAPSHOT</version> <version>4.7.1</version>
<name>ms-mcms</name> <name>ms-mcms</name>
<properties> <properties>
<java.version>1.8</java.version> <java.version>1.8</java.version>
...@@ -38,24 +37,19 @@ ...@@ -38,24 +37,19 @@
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-mpeople</artifactId> <artifactId>ms-basic</artifactId>
<version>1.0.7</version> <version>1.0.11</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-upgrader</artifactId> <artifactId>ms-mpeople</artifactId>
<version>1.0.5-SNAPSHOT</version> <version>1.0.8</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency> </dependency>
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
<dependency> <dependency>
<groupId>org.apache.tomcat.embed</groupId> <groupId>net.mingsoft</groupId>
<artifactId>tomcat-embed-jasper</artifactId> <artifactId>ms-upgrader</artifactId>
<version>9.0.16</version> <version>1.0.8</version>
</dependency> </dependency>
</dependencies> </dependencies>
<build> <build>
......
...@@ -9,6 +9,8 @@ import java.util.List; ...@@ -9,6 +9,8 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import net.mingsoft.basic.util.ArrysUtil;
import net.mingsoft.mdiy.util.DictUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -84,6 +86,8 @@ public class ColumnAction extends BaseAction{ ...@@ -84,6 +86,8 @@ public class ColumnAction extends BaseAction{
int appId =BasicUtil.getAppId(); int appId =BasicUtil.getAppId();
List<ColumnEntity> list = columnBiz.queryAll(appId, BasicUtil.getModelCodeId(net.mingsoft.cms.constant.ModelCode.CMS_COLUMN.toString())); List<ColumnEntity> list = columnBiz.queryAll(appId, BasicUtil.getModelCodeId(net.mingsoft.cms.constant.ModelCode.CMS_COLUMN.toString()));
ColumnEntity columnSuper = new ColumnEntity(); ColumnEntity columnSuper = new ColumnEntity();
// 栏目属性
model.addAttribute("columnFlag", DictUtil.list("栏目属性"));
model.addAttribute("appId",appId); model.addAttribute("appId",appId);
model.addAttribute("columnSuper", columnSuper); model.addAttribute("columnSuper", columnSuper);
model.addAttribute("column",new ColumnEntity()); model.addAttribute("column",new ColumnEntity());
...@@ -199,6 +203,8 @@ public class ColumnAction extends BaseAction{ ...@@ -199,6 +203,8 @@ public class ColumnAction extends BaseAction{
list = columnBiz.queryAll(appId, BasicUtil.getModelCodeId(net.mingsoft.cms.constant.ModelCode.CMS_COLUMN.toString())); list = columnBiz.queryAll(appId, BasicUtil.getModelCodeId(net.mingsoft.cms.constant.ModelCode.CMS_COLUMN.toString()));
//查询当前栏目实体 //查询当前栏目实体
ColumnEntity column = (ColumnEntity) columnBiz.getEntity(columnId); ColumnEntity column = (ColumnEntity) columnBiz.getEntity(columnId);
// 栏目属性
model.addAttribute("columnFlag", DictUtil.list("栏目属性"));
model.addAttribute("appId",appId); model.addAttribute("appId",appId);
model.addAttribute("column", column); model.addAttribute("column", column);
model.addAttribute("columnc", column.getCategoryId()); model.addAttribute("columnc", column.getCategoryId());
...@@ -245,6 +251,13 @@ public class ColumnAction extends BaseAction{ ...@@ -245,6 +251,13 @@ public class ColumnAction extends BaseAction{
column.setCategoryManagerId(getManagerBySession(request).getManagerId()); column.setCategoryManagerId(getManagerBySession(request).getManagerId());
column.setCategoryDateTime(new Timestamp(System.currentTimeMillis())); column.setCategoryDateTime(new Timestamp(System.currentTimeMillis()));
column.setCategoryModelId(BasicUtil.getModelCodeId(net.mingsoft.cms.constant.ModelCode.CMS_COLUMN.toString())); column.setCategoryModelId(BasicUtil.getModelCodeId(net.mingsoft.cms.constant.ModelCode.CMS_COLUMN.toString()));
String checkboxType = BasicUtil.getString("checkboxType");
//如果选择一个属性不做排序操作
if(!StringUtils.isEmpty(checkboxType) && checkboxType.length()>2){
column.setColumnFlag(ArrysUtil.sort(checkboxType, ",")+",");
}else{
column.setColumnFlag(checkboxType);
}
if(column.getColumnType()==ColumnEntity.ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()){ if(column.getColumnType()==ColumnEntity.ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()){
column.setColumnListUrl(null); column.setColumnListUrl(null);
} }
...@@ -274,6 +287,13 @@ public class ColumnAction extends BaseAction{ ...@@ -274,6 +287,13 @@ public class ColumnAction extends BaseAction{
} }
column.setCategoryManagerId(getManagerBySession(request).getManagerId()); column.setCategoryManagerId(getManagerBySession(request).getManagerId());
column.setAppId(websiteId); column.setAppId(websiteId);
String checkboxType = BasicUtil.getString("checkboxType");
//如果选择一个属性不做排序操作
if(!StringUtils.isEmpty(checkboxType) && checkboxType.length()>2){
column.setColumnFlag(ArrysUtil.sort(checkboxType, ",")+",");
}else{
column.setColumnFlag(checkboxType);
}
columnBiz.updateCategory(column); columnBiz.updateCategory(column);
this.columnPath(request,column); this.columnPath(request,column);
//查询当前栏目是否有子栏目, //查询当前栏目是否有子栏目,
......
...@@ -30,6 +30,8 @@ import java.util.List; ...@@ -30,6 +30,8 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -194,8 +196,17 @@ public class GeneraterAction extends BaseAction { ...@@ -194,8 +196,17 @@ public class GeneraterAction extends BaseAction {
CmsParserUtil.generateList(column, articleIdList.size()); CmsParserUtil.generateList(column, articleIdList.size());
break; break;
case ColumnEntity.COLUMN_TYPE_COVER:// 单页 case ColumnEntity.COLUMN_TYPE_COVER:// 单页
if(articleIdList.size()==0){
ColumnArticleIdBean columnArticleIdBean=new ColumnArticleIdBean();
CopyOptions copyOptions=CopyOptions.create();
copyOptions.setIgnoreError(true);
BeanUtil.copyProperties(column,columnArticleIdBean,copyOptions);
articleIdList.add(columnArticleIdBean);
}
CmsParserUtil.generateBasic(articleIdList); CmsParserUtil.generateBasic(articleIdList);
break; break;
default:
throw new IllegalStateException("Unexpected value: " + column.getColumnType());
} }
} }
} catch (IOException e) { } catch (IOException e) {
......
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
...@@ -21,13 +21,23 @@ The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) ...@@ -21,13 +21,23 @@ The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
package net.mingsoft.cms.action.web; package net.mingsoft.cms.action.web;
import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.io.FileUtil;
import com.github.pagehelper.PageHelper;
import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.cms.constant.e.ColumnTypeEnum;
import net.mingsoft.mdiy.biz.IContentModelBiz;
import net.mingsoft.mdiy.entity.ContentModelEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ExceptionHandler;
...@@ -60,7 +70,7 @@ import net.mingsoft.mdiy.util.ParserUtil; ...@@ -60,7 +70,7 @@ import net.mingsoft.mdiy.util.ParserUtil;
*/ */
@Controller("dynamicPageAction") @Controller("dynamicPageAction")
@RequestMapping("/mcms") @RequestMapping("/mcms")
public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction { public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
/** /**
* 自定义页面业务层 * 自定义页面业务层
...@@ -204,13 +214,21 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction { ...@@ -204,13 +214,21 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
* @param id 文章编号 * @param id 文章编号
*/ */
@GetMapping("/view.do") @GetMapping("/view.do")
public void view(HttpServletRequest req, HttpServletResponse resp) { public void view(String orderby,String order,HttpServletRequest req, HttpServletResponse resp) {
//参数文章编号 //参数文章编号
ArticleEntity article = (ArticleEntity) articleBiz.getEntity(BasicUtil.getInt(ParserUtil.ID)); ArticleEntity article = (ArticleEntity) articleBiz.getEntity(BasicUtil.getInt(ParserUtil.ID));
if(ObjectUtil.isNull(article)){ if(ObjectUtil.isNull(article)){
this.outJson(resp, null,false,getResString("err.empty", this.getResString("id"))); this.outJson(resp, null,false,getResString("err.empty", this.getResString("id")));
return; return;
} }
if(StringUtils.isNotBlank(order)){
//防注入
if(!order.toLowerCase().equals("asc")&&!order.toLowerCase().equals("desc")){
this.outJson(resp, null,false,getResString("err.error", this.getResString("order")));
return;
}
}
PageBean page = new PageBean();
//根据文章编号查询栏目详情模版 //根据文章编号查询栏目详情模版
ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId()); ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId());
//解析后的内容 //解析后的内容
...@@ -221,6 +239,55 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction { ...@@ -221,6 +239,55 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
//设置动态请求的模块路径 //设置动态请求的模块路径
map.put(ParserUtil.MODEL_NAME, "mcms"); map.put(ParserUtil.MODEL_NAME, "mcms");
map.put(ParserUtil.URL, BasicUtil.getUrl()); map.put(ParserUtil.URL, BasicUtil.getUrl());
map.put(ParserUtil.PAGE, page);
map.put(ParserUtil.ID, article.getArticleID());
List<ColumnArticleIdBean> articleIdList = articleBiz.queryIdsByCategoryIdForParser(column.getCategoryCategoryId(), null, null,orderby,order);
Map<Object, Object> contentModelMap = new HashMap<Object, Object>();
ContentModelEntity contentModel = null;
for (int artId = 0; artId < articleIdList.size();) {
//如果不是当前文章则跳过
if(articleIdList.get(artId).getArticleId() != article.getArticleID()){
artId++;
continue;
}
// 文章的栏目路径
String articleColumnPath = articleIdList.get(artId).getColumnPath();
// 文章的栏目模型编号
int columnContentModelId = articleIdList.get(artId).getColumnContentModelId();
Map<String, Object> parserParams = new HashMap<String, Object>();
parserParams.put(ParserUtil.COLUMN, articleIdList.get(artId));
// 判断当前栏目是否有自定义模型
if (columnContentModelId > 0) {
// 通过当前栏目的模型编号获取,自定义模型表名
if (contentModelMap.containsKey(columnContentModelId)) {
parserParams.put(ParserUtil.TABLE_NAME, contentModel.getCmTableName());
} else {
// 通过栏目模型编号获取自定义模型实体
contentModel = (ContentModelEntity) SpringUtil.getBean(IContentModelBiz.class)
.getEntity(columnContentModelId);
// 将自定义模型编号设置为key值
contentModelMap.put(columnContentModelId, contentModel.getCmTableName());
parserParams.put(ParserUtil.TABLE_NAME, contentModel.getCmTableName());
}
}
// 第一篇文章没有上一篇
if (artId > 0) {
ColumnArticleIdBean preCaBean = articleIdList.get(artId - 1);
//判断当前文档是否与上一页文章在同一栏目下,并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if(articleColumnPath.contains(preCaBean.getCategoryId()+"")){
page.setPreId(preCaBean.getArticleId());
}
}
// 最后一篇文章没有下一篇
if (artId + 1 < articleIdList.size()) {
ColumnArticleIdBean nextCaBean = articleIdList.get(artId + 1);
//判断当前文档是否与下一页文章在同一栏目下并且不能使用父栏目字符串,因为父栏目中没有所属栏目编号
if(articleColumnPath.contains(nextCaBean.getCategoryId()+"")){
page.setNextId(nextCaBean.getArticleId());
}
}
break;
}
try { try {
//根据模板路径,参数生成 //根据模板路径,参数生成
content = CmsParserUtil.generate(column.getColumnUrl(), map, isMobileDevice(req)); content = CmsParserUtil.generate(column.getColumnUrl(), map, isMobileDevice(req));
......
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
...@@ -147,7 +147,16 @@ public interface IArticleBiz extends IBasicBiz { ...@@ -147,7 +147,16 @@ public interface IArticleBiz extends IBasicBiz {
* @return * @return
*/ */
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime); public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime);
/**
* 查询文章编号集合
* @param categoryId 栏目编号
* @param beginTime 开始时间
* @param endTime 结束时间
* @param orderBy 排序字段
* @param order 排序方式
* @return
*/
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime,String orderBy,String order);
/** /**
* 根据页面栏目的id获取与其绑定的文章实体 * 根据页面栏目的id获取与其绑定的文章实体
* *
......
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
...@@ -25,6 +25,7 @@ import java.util.ArrayList; ...@@ -25,6 +25,7 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -212,6 +213,10 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz { ...@@ -212,6 +213,10 @@ public class ArticleBizImpl extends BasicBizImpl implements IArticleBiz {
@Override @Override
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime) { public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime) {
return this.articleDao.queryIdsByCategoryIdForParser(categoryId,BasicUtil.getAppId(), beginTime, endTime); return this.articleDao.queryIdsByCategoryIdForParser(categoryId,BasicUtil.getAppId(), beginTime, endTime,null,null);
}
@Override
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(int categoryId, String beginTime,String endTime,String orderBy,String order) {
return this.articleDao.queryIdsByCategoryIdForParser(categoryId,BasicUtil.getAppId(), beginTime, endTime,orderBy,order);
} }
} }
\ No newline at end of file
/** /**
The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
* Permission is hereby granted, free of charge, to any person obtaining a copy of * Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in * this software and associated documentation files (the "Software"), to deal in
...@@ -163,5 +163,7 @@ public interface IArticleDao extends IBaseDao { ...@@ -163,5 +163,7 @@ public interface IArticleDao extends IBaseDao {
* @param endTime 结束时间 * @param endTime 结束时间
* @return * @return
*/ */
public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(@Param("categoryId")int categoryId,@Param("appId")int appId , @Param("beginTime") String beginTime,@Param("endTime") String endTime); public List<ColumnArticleIdBean> queryIdsByCategoryIdForParser(@Param("categoryId")int categoryId,@Param("appId")int appId , @Param("beginTime") String beginTime,@Param("endTime") String endTime,@Param("orderBy")String orderBy,@Param("order")String order);
} }
\ No newline at end of file
...@@ -50,6 +50,7 @@ ...@@ -50,6 +50,7 @@
<result column="ARTICLE_BASICID" property="articleId" /> <result column="ARTICLE_BASICID" property="articleId" />
<result column="column_path" property="columnPath"/> <result column="column_path" property="columnPath"/>
<result column="column_url" property="columnUrl" /> <result column="column_url" property="columnUrl" />
<result column="column_listurl" property="columnListUrl" />
<result column="category_title" property="categoryTitle" /> <result column="category_title" property="categoryTitle" />
<result column="category_id" property="categoryId" /> <result column="category_id" property="categoryId" />
<result column="COLUMN_CM_ID" property="columnContentModelId" /> <result column="COLUMN_CM_ID" property="columnContentModelId" />
...@@ -321,8 +322,8 @@ ...@@ -321,8 +322,8 @@
<select id="queryIdsByCategoryIdForParser" resultMap="resultMapBean" > <select id="queryIdsByCategoryIdForParser" resultMap="resultMapBean" >
select select
ARTICLE_BASICID,cl.*,c.* ARTICLE_BASICID,cl.*,c.*
FROM cms_article a LEFT JOIN basic b ON a.ARTICLE_BASICID = b.BASIC_ID FROM cms_article a LEFT JOIN basic ON a.ARTICLE_BASICID = basic.BASIC_ID
LEFT JOIN basic_column cl ON b.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID LEFT JOIN basic_column cl ON basic.BASIC_CATEGORYID = cl.COLUMN_CATEGORY_ID
JOIN category c ON c.CATEGORY_ID = cl.COLUMN_CATEGORY_ID JOIN category c ON c.CATEGORY_ID = cl.COLUMN_CATEGORY_ID
where where
<if test="appId &gt; 0"> <if test="appId &gt; 0">
...@@ -330,14 +331,17 @@ ...@@ -330,14 +331,17 @@
</if> </if>
<!-- 查询子栏目数据 --> <!-- 查询子栏目数据 -->
<if test="categoryId &gt; 0"> <if test="categoryId &gt; 0">
and (b.basic_categoryid=#{categoryId} or b.basic_categoryid in and (basic.basic_categoryid=#{categoryId} or basic.basic_categoryid in
(select category_id FROM category where <include refid="queryWhereCategoryId"></include>)) (select category_id FROM category where <include refid="queryWhereCategoryId"></include>))
</if> </if>
<if test="beginTime!=null and beginTime!=''"> <if test="beginTime!=null and beginTime!=''">
and b.basic_updatetime &gt;= #{beginTime} and basic.basic_updatetime &gt;= #{beginTime}
</if> </if>
<if test="endTime!=null and endTime!=''"> <if test="endTime!=null and endTime!=''">
and b.basic_updatetime &gt;= #{endTime} and basic.basic_updatetime &gt;= #{endTime}
</if>
<if test="orderBy!=null and order!=null and orderBy!='' and order!=''">
ORDER BY `${orderBy}` ${order}
</if> </if>
</select> </select>
......
#mcms\u7248\u672c #mcms\u7248\u672C
version=d3a98fefcb242db78da5fc31608ff247 version=d3a98fefcb242db78da5fc31608ff247
templet.file=\u6a21\u677f\u6587\u4ef6\u4e0d\u5b58\u5728 templet.file=\u6A21\u677F\u6587\u4EF6\u4E0D\u5B58\u5728
id=\u6587\u7ae0\u7f16\u53f7 id=\u6587\u7AE0\u7F16\u53F7
typeid=\u680f\u76ee\u7f16\u53f7 typeid=\u680F\u76EE\u7F16\u53F7
order=\u6392\u5E8F
package net.mingsoft.config; package net.mingsoft.config;
import java.io.File;
import java.util.Arrays;
import net.mingsoft.basic.filter.XSSEscapeFilter;
import org.springframework.aop.Advisor; import org.springframework.aop.Advisor;
import org.springframework.aop.support.DefaultPointcutAdvisor; import org.springframework.aop.support.DefaultPointcutAdvisor;
import org.springframework.aop.support.JdkRegexpMethodPointcut; import org.springframework.aop.support.JdkRegexpMethodPointcut;
...@@ -23,6 +27,7 @@ import com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator; ...@@ -23,6 +27,7 @@ import com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator;
import com.alibaba.druid.support.spring.stat.DruidStatInterceptor; import com.alibaba.druid.support.spring.stat.DruidStatInterceptor;
import net.mingsoft.basic.interceptor.ActionInterceptor; import net.mingsoft.basic.interceptor.ActionInterceptor;
import net.mingsoft.basic.util.BasicUtil;
@Configuration @Configuration
public class WebConfig implements WebMvcConfigurer { public class WebConfig implements WebMvcConfigurer {
...@@ -50,12 +55,20 @@ public class WebConfig implements WebMvcConfigurer { ...@@ -50,12 +55,20 @@ public class WebConfig implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
//jar包方式映射处理
String classPath = BasicUtil.getClassPath("");
if (classPath.startsWith("file")) {
registry.addResourceHandler("/upload/**").addResourceLocations("file:" + BasicUtil.getRealPath("upload") + File.separator);
registry.addResourceHandler("/html/**").addResourceLocations("file:" + BasicUtil.getRealPath("html") + File.separator);
registry.addResourceHandler("/templets/**").addResourceLocations("file:" + BasicUtil.getRealPath("templets") + File.separator);
} else {
//必须做判断,不然jar运行的html路径会被覆盖掉
registry.addResourceHandler("/html/**").addResourceLocations("/html/"); registry.addResourceHandler("/html/**").addResourceLocations("/html/");
registry.addResourceHandler("/app/**").addResourceLocations("classpath:/app/");
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("/api/**").addResourceLocations("classpath:/api/");
} }
registry.addResourceHandler("/app/**").addResourceLocations("/app/", "classpath:/app/");
registry.addResourceHandler("/static/**").addResourceLocations("/static/", "classpath:/static/");
registry.addResourceHandler("/api/**").addResourceLocations("/api/", "classpath:/api/");
}
/** /**
* druidServlet注册 * druidServlet注册
*/ */
...@@ -120,18 +133,16 @@ public class WebConfig implements WebMvcConfigurer { ...@@ -120,18 +133,16 @@ public class WebConfig implements WebMvcConfigurer {
return new DefaultPointcutAdvisor(druidStatPointcut(), druidStatInterceptor()); return new DefaultPointcutAdvisor(druidStatPointcut(), druidStatInterceptor());
} }
// /** /**
// * xssFilter注册 * xssFilter注册
// */ */
// @Bean @Bean
// public FilterRegistrationBean xssFilterRegistration() { public FilterRegistrationBean xssFilterRegistration() {
// XssFilter xssFilter = new XssFilter(); XSSEscapeFilter xssFilter = new XSSEscapeFilter();
// xssFilter.setUrlExclusion(Arrays.asList("/static/")); FilterRegistrationBean registration = new FilterRegistrationBean(xssFilter);
// FilterRegistrationBean registration = new registration.addUrlPatterns("/*");
// FilterRegistrationBean(xssFilter); return registration;
// registration.addUrlPatterns("/*"); }
// return registration;
// }
/** /**
* RequestContextListener注册 * RequestContextListener注册
......
...@@ -13,7 +13,7 @@ ms: ...@@ -13,7 +13,7 @@ ms:
upload: upload:
path: /upload path: /upload
denied: exe denied: .exe,.jsp
allowed: jpg allowed: jpg
max-size: 1 max-size: 1
memory-size: 4096 memory-size: 4096
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
field: 'basicDateTime', field: 'basicDateTime',
title: '发布时间', title: '发布时间',
align: 'center', align: 'center',
width: 90 width: 150
}] }]
}); });
//查询文章标题 //查询文章标题
......
<!DOCTYPE html>
<html lang="zh">
<head>
<title>${app.appName}</title>
<#include "/include/head-file.ftl"/>
<script src="${base}/static/plugins/jquery/3.2.1/jquery.min.js"></script>
<script src="${base}/static/plugins/jquery.cookie/1.4.1/jquery.cookie.min.js"></script>
<link rel="stylesheet" href="${base}/static/ms-admin/4.7.0/css/login.css">
</head>
<body>
<div id="login" class="login">
<el-container class="ms-admin-login-container">
<el-main class="ms-admin-login-main">
<div class="ms-admin-login-warp" @keydown.13='checkLogin'>
<img style="height: 360px" :src="ms.base+'/static/ms-admin/4.7.0/images/login-slogn.png'">
<el-form :model="loginForm" status-icon :rules="loginFormRule" style="height: 360px" ref="loginForm" label-width="100px" class="ms-admin-login-form">
<el-alert
style="margin-bottom: 10px;"
title="演示版部分删除功能已去除"
type="warning"
center
:closable="false"
show-icon>
</el-alert>
<h1>
<span>账户登录 / </span>User login</h1>
<el-form-item class="ms-admin-form-item" prop="managerName">
<el-input type="text" placeholder='用户名/admin' v-model="loginForm.managerName" ></el-input>
</el-form-item>
<el-form-item class="ms-admin-form-item" prop="managerPassword">
<el-input type="password" placeholder='密码/123456' v-model="loginForm.managerPassword"></el-input>
</el-form-item>
<el-form-item class="ms-admin-form-item ms-admin-form-item-code" prop="rand_code">
<el-input type="text" placeholder='验证码' v-model="loginForm.rand_code" autocomplete="off"></el-input>
<img :src="verifCode" class="code-img" @click="code" />
<p>
<span>看不清?</span>
<span @click="code">换一张</span>
</p>
</el-form-item>
<el-form-item class="ms-admin-form-item ms-admin-form-item-checkout">
<el-checkbox v-model="rememberPass">记住密码</el-checkbox>
</el-form-item>
<el-form-item class="ms-admin-form-item">
<el-button type="primary" @click="checkLogin" class="ms-admin-login-btn">登录</el-button>
</el-form-item>
</el-form>
</div>
</el-main>
</el-container>
</div>
</body>
</html>
<script>
var loginVue = new Vue({
el: '#login',
data: {
loginForm: {
managerName: 'admin',
managerPassword: "123456",
rand_code: ''
},
verifCode: ms.manager + "/code?t=" + new Date().getTime(),
rememberPass: '',
loginFormRule: {
managerName: [{
required: true,
message: '请输入用户名',
trigger: 'blur'
},
{
min: 1,
max: 30,
message: '长度在 1 到 30 个字符',
trigger: 'blur'
}
],
managerPassword: [{
required: true,
message: '请输入密码',
trigger: 'blur'
},
{
min: 1,
max: 30,
message: '长度在 1 到 30 个字符',
trigger: 'blur'
}
],
rand_code: [{
required: true,
message: '请填写验证码',
trigger: 'blur'
},
{
min: 1,
max: 4,
message: '长度在1 到 4 个字符',
trigger: 'blur'
}
],
}
},
methods: {
// 登录
checkLogin: function() {
var that = this;
this.$refs['loginForm'].validate((valid) => {
if(valid) {
ms.http.post(ms.manager + "/checkLogin.do", that.loginForm).then(function(data) {
if(data.result) {
if(that.rememberPass) {
$.cookie('managerName',that.loginForm.managerName, { expires: 365 });
$.cookie('managerPassword',that.loginForm.managerPassword, { expires: 365 });
} else {
$.cookie('managerName',"");
$.cookie('managerPassword',"");
}
that.$notify({
title: '成功',
message: '登录成功',
type: 'success'
});
location.href = ms.manager + "/index.do";
} else {
that.$notify({
title: '失败',
message: data.resultMsg,
type: 'warning'
});
that.code();
}
}, (err) => {
that.$message.error(data.resultMsg);
})
}
});
},
code: function() {
this.verifCode = ms.web + "/code?t=" + new Date().getTime();
},
},
mounted: function() {
this.verifCode = ms.web + "/code?t=" + new Date().getTime();
if($.cookie('managerName')){
this.loginForm.managerName = $.cookie('managerName');
this.loginForm.managerPassword = $.cookie('managerPassword');
}
if (top.location != self.location){
top.location = self.location;
}
}
})
</script>
\ No newline at end of file
This diff is collapsed.
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<body> <body>
<#include "head.htm"/> <#include "head.htm"/>
<div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}images/about_us.jpg) no-repeat center;"> <div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}/images/about_us.jpg) no-repeat center;">
<p class="banner_tit_about animated fadeInLeft">关于我们</p> <p class="banner_tit_about animated fadeInLeft">关于我们</p>
<p class="banner_tit_about_des animated fadeInRight">About us</p> <p class="banner_tit_about_des animated fadeInRight">About us</p>
</div> </div>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
</head> </head>
<body> <body>
<#include "head.htm"/> <#include "head.htm"/>
<div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}images/talk_online.jpeg) no-repeat center;"> <div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}/images/talk_online.jpeg) no-repeat center;">
<p class="banner_tit_other animated fadeInLeft">在线留言</p> <p class="banner_tit_other animated fadeInLeft">在线留言</p>
<p class="banner_tit_other_des animated fadeInRight">Talk online</p> <p class="banner_tit_other_des animated fadeInRight">Talk online</p>
</div> </div>
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<body> <body>
<#include "head.htm"/> <#include "head.htm"/>
<div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}images/00.png) no-repeat center;"> <div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}/images/00.png) no-repeat center;">
<p class="banner_tit_other animated fadeInLeft">&nbsp;&nbsp;&nbsp;</p> <p class="banner_tit_other animated fadeInLeft">&nbsp;&nbsp;&nbsp;</p>
<p class="banner_tit_other_des animated fadeInRight">Case list</p> <p class="banner_tit_other_des animated fadeInRight">Case list</p>
</div> </div>
......
<title>{ms:global.name/}</title> <title>{ms:global.name/}</title>
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="icon" href="http://cdn.mingsoft.net/global/images/ms.ico" type="x-icon">
<link rel="stylesheet" type="text/css" href="{ms:global.host/}/plugins/iconfont/1.0.0/iconfont.css" /> <link rel="stylesheet" type="text/css" href="{ms:global.host/}/plugins/iconfont/1.0.0/iconfont.css" />
<link rel="stylesheet/less" type="text/css" href="{ms:global.host/}/{ms:global.style/}/less/base.less"> <link rel="stylesheet/less" type="text/css" href="{ms:global.host/}/{ms:global.style/}/less/base.less">
<link rel="stylesheet/less" type="text/css" href="{ms:global.host/}/{ms:global.style/}/less/index.less"> <link rel="stylesheet/less" type="text/css" href="{ms:global.host/}/{ms:global.style/}/less/index.less">
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<#include "m/head-file.htm"/> <#include "/m/head-file.htm"/>
<body> <body>
<#include "m/head.htm"/> <#include "/m/head.htm"/>
<div class="ms-banner"> <div class="ms-banner">
<img src="{ms:global.host/}/{ms:global.style/}/images/about.png" class="am-img-responsive" alt=""/> <img src="{ms:global.host/}/{ms:global.style/}/images/about.png" class="am-img-responsive" alt=""/>
</div> </div>
...@@ -30,6 +30,6 @@ ...@@ -30,6 +30,6 @@
</div> </div>
</div> </div>
</div> </div>
<#include "m/footer.htm"/> <#include "/m/footer.htm"/>
</body> </body>
</html> </html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<#include "m/head-file.htm"/> <#include "/m/head-file.htm"/>
<body> <body>
<#include "m/head.htm"/> <#include "/m/head.htm"/>
<div class="ms-banner"> <div class="ms-banner">
<img src="{ms:global.host/}/{ms:global.style/}/images/message.png" alt="" width="100%" /> <img src="{ms:global.host/}/{ms:global.style/}/images/message.png" alt="" width="100%" />
</div> </div>
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<button type="button" class="am-btn am-btn-primary ms-content-button">提交</button> <button type="button" class="am-btn am-btn-primary ms-content-button">提交</button>
</form> </form>
</div> </div>
<#include "m/footer.htm"/> <#include "/m/footer.htm"/>
</body> </body>
</html> </html>
<script> <script>
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<#include "m/head-file.htm"/> <#include "/m/head-file.htm"/>
<body> <body>
<#include "m/head.htm"/> <#include "/m/head.htm"/>
<div class="ms-banner"> <div class="ms-banner">
<img src="{ms:global.host/}/{ms:global.style/}/images/mo.png" class="am-img-responsive" alt=""/> <img src="{ms:global.host/}/{ms:global.style/}/images/mo.png" class="am-img-responsive" alt=""/>
</div> </div>
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
{/ms:arclist} {/ms:arclist}
</ul> </ul>
</div> </div>
<#include "m/footer.htm"/> <#include "/m/footer.htm"/>
</body> </body>
</html> </html>
<script> <script>
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<#include "m/head-file.htm"/> <#include "/m/head-file.htm"/>
<body> <body>
<#include "m/head.htm"/> <#include "/m/head.htm"/>
<div class="ms-banner"> <div class="ms-banner">
<img src="{ms:global.host/}/{ms:global.style/}/images/about.png" class="am-img-responsive" alt=""/> <img src="{ms:global.host/}/{ms:global.style/}/images/about.png" class="am-img-responsive" alt=""/>
</div> </div>
...@@ -30,6 +30,6 @@ ...@@ -30,6 +30,6 @@
</div> </div>
</div> </div>
</div> </div>
<#include "m/footer.htm"/> <#include "/m/footer.htm"/>
</body> </body>
</html> </html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<#include "m/head-file.htm"/> <#include "/m/head-file.htm"/>
<body> <body>
<#include "m/head.htm"/> <#include "/m/head.htm"/>
<div class="ms-banner"> <div class="ms-banner">
<img src="{ms:global.host/}/{ms:global.style/}/images/case.png" class="am-img-responsive" alt=""/> <img src="{ms:global.host/}/{ms:global.style/}/images/case.png" class="am-img-responsive" alt=""/>
</div> </div>
...@@ -20,6 +20,6 @@ ...@@ -20,6 +20,6 @@
</div> </div>
</div> </div>
</div> </div>
<#include "m/footer.htm"/> <#include "/m/footer.htm"/>
</body> </body>
</html> </html>
\ No newline at end of file
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<#include "m/head-file.htm"/> <#include "/m/head-file.htm"/>
<link rel="stylesheet" type="text/css" href="{ms:global.host/}/{ms:global.style/}/css/jquery.sinaemotion.css" /> <link rel="stylesheet" type="text/css" href="{ms:global.host/}/{ms:global.style/}/css/jquery.sinaemotion.css" />
<script type="text/javascript" src="{ms:global.host/}/{ms:global.style/}/js/jquery.sinaEmotion.js"></script> <script type="text/javascript" src="{ms:global.host/}/{ms:global.style/}/js/jquery.sinaEmotion.js"></script>
</head> </head>
<body> <body>
<#include "m/head.htm"/> <#include "/m/head.htm"/>
<div class="ms-banner"> <div class="ms-banner">
<img src="{ms:global.host/}/{ms:global.style/}/images/case.png" class="am-img-responsive" alt="" /> <img src="{ms:global.host/}/{ms:global.style/}/images/case.png" class="am-img-responsive" alt="" />
</div> </div>
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
</div> </div>
</div> </div>
</div> </div>
<#include "m/footer.htm"/> <#include "/m/footer.htm"/>
</body> </body>
<script> <script>
var newsShowVue = new Vue({ var newsShowVue = new Vue({
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<body> <body>
<#include "head.htm"> <#include "head.htm">
<div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}images/news2.png) no-repeat center;"> <div class="ms-banner" style="background:url({ms:global.host/}/{ms:global.style/}/images/news2.png) no-repeat center;">
<p class="banner_tit_other animated fadeInLeft">公司动态</p> <p class="banner_tit_other animated fadeInLeft">公司动态</p>
<p class="banner_tit_other_des animated fadeInRight">Our company</p> <p class="banner_tit_other_des animated fadeInRight">Our company</p>
......
...@@ -27,10 +27,10 @@ ...@@ -27,10 +27,10 @@
</ul> </ul>
</div> </div>
<div class="ms-content-main-page"> <div class="ms-content-main-page">
<a class="ms-content-main-page-first" href="{ms:global.url/}{ms:page.index/}">首页</a> <a class="ms-content-main-page-first" href="{ms:page.index/}">首页</a>
<a class="ms-content-main-page-upper" href="{ms:global.url/}{ms:page.pre/}">上一页</a> <a class="ms-content-main-page-upper" href="{ms:page.pre/}">上一页</a>
<a class="ms-content-main-page-next" href="{ms:global.url/}{ms:page.next/}">下一页</a> <a class="ms-content-main-page-next" href="{ms:page.next/}">下一页</a>
<a class="ms-content-main-page-last" href="{ms:global.url/}{ms:page.last/}">末页</a> <a class="ms-content-main-page-last" href="{ms:page.last/}">末页</a>
</div> </div>
</div> </div>
</div> </div>
......
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