Commit d9175124 authored by 他是超人他会飞's avatar 他是超人他会飞 Committed by 铭飞

!148 脏数据和请求方式、设置静态化的域名

Merge pull request !148 from 他是超人他会飞/4.7.0
parents e1835775 900f27b6
This diff is collapsed.
...@@ -452,13 +452,18 @@ app_copyright as copyright, ...@@ -452,13 +452,18 @@ app_copyright as copyright,
<#--动态解析 --> <#--动态解析 -->
<#if isDo?? && isDo> <#if isDo?? && isDo>
''${url}'' as url, ''${url}'' as url,
''${url}'' as host,
<#--使用地址栏的域名 -->
<#elseif url??>
''${url}/${html}/''+app_id+''/<#if m??>${m}</#if>'' as url,
''${url}'' as host,
<#else> <#else>
REPLACE(<#-- 剔除换行符 --> REPLACE(<#-- 剔除换行符 -->
substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''')+''/html/''+convert(varchar(50),app_id)+''/<#if m??>m</#if>'' as url, substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''')+''/${html}/''+convert(varchar(50),app_id)+''/<#if m??>${m}</#if>'' as url,
</#if>
REPLACE(<#-- 剔除换行符 --> REPLACE(<#-- 剔除换行符 -->
substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''') as host, substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''') as host,
''templets/''+convert(varchar(50),app_id)+''/''<#if m??>+app_style+''/m''<#else>+app_style</#if> as style <#-- 判断是否为手机端 --> </#if>
''templets/''+convert(varchar(50),app_id)+''/''<#if m??>+app_style+''/${m}''<#else>+app_style</#if> as style <#-- 判断是否为手机端 -->
from app', N'1') from app', N'1')
GO GO
......
...@@ -3,9 +3,14 @@ db-mcms-mysql-4.7.0 最低版本mysql 5.7 ...@@ -3,9 +3,14 @@ db-mcms-mysql-4.7.0 最低版本mysql 5.7
db-mcms-sqlserver-4.7.0 最低版本 SQLServer2012 db-mcms-sqlserver-4.7.0 最低版本 SQLServer2012
如果使用低与要求版本数据库会出现如下错误 如果使用低与要求版本数据库会出现如下错误
1、导入 mysql文件 datetime时间函数报错,请使用4.6. 1、导入 mysql文件 datetime时间函数报错,请使用4.6.5版本以下的SQL文件(不包含4.6.5)
2、SQLServer数据库版本 自定义标签 使用了SQLServer2012最新的分页函数 , 2、SQLServer数据库版本 自定义标签 使用了SQLServer2012最新的分页函数 ,
请自行修改mdiy_tag_sql表中的分页函数 请自行修改mdiy_tag_sql表中的分页函数
数据库类型切换 :修改application.yml中 数据库类型切换 :修改application.yml中
database-id: mysql、sqlServer、oracle database-id: mysql、sqlServer、oracle
\ No newline at end of file 数据库连接切换:修改
spring:
http.multipart.enabled: false
profiles:
active: dev、prod、test
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2264,13 +2264,18 @@ app_copyright as copyright, ...@@ -2264,13 +2264,18 @@ app_copyright as copyright,
<#--动态解析 --> <#--动态解析 -->
<#if isDo?? && isDo> <#if isDo?? && isDo>
''${url}'' as url, ''${url}'' as url,
''${url}'' as host,
<#--使用地址栏的域名 -->
<#elseif url??>
''${url}/${html}/''+app_id+''/<#if m??>${m}</#if>'' as url,
''${url}'' as host,
<#else> <#else>
REPLACE(<#-- 剔除换行符 --> REPLACE(<#-- 剔除换行符 -->
substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''')+''/html/''+convert(varchar(50),app_id)+''/<#if m??>m</#if>'' as url, substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''')+''/${html}/''+convert(varchar(50),app_id)+''/<#if m??>${m}</#if>'' as url,
</#if>
REPLACE(<#-- 剔除换行符 --> REPLACE(<#-- 剔除换行符 -->
substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''') as host, substring( app_url, 0, CHARINDEX ( CHAR ( 10 ), app_url ) ),CHAR ( 13 ),'''') as host,
''templets/''+convert(varchar(50),app_id)+''/''<#if m??>+app_style+''/m''<#else>+app_style</#if> as style <#-- 判断是否为手机端 --> </#if>
''templets/''+convert(varchar(50),app_id)+''/''<#if m??>+app_style+''/${m}''<#else>+app_style</#if> as style <#-- 判断是否为手机端 -->
from app', N'1'), (N'8', N'7', N'SELECT from app', N'1'), (N'8', N'7', N'SELECT
basic_id as id, basic_id as id,
left(basic_title,${titlelen?default(40)}) as title, left(basic_title,${titlelen?default(40)}) as title,
......
...@@ -35,10 +35,12 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -35,10 +35,12 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import cn.hutool.core.util.ObjectUtil;
import net.mingsoft.basic.biz.IColumnBiz; import net.mingsoft.basic.biz.IColumnBiz;
import net.mingsoft.basic.entity.ColumnEntity; import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.cms.bean.ColumnArticleIdBean; import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.biz.IArticleBiz; import net.mingsoft.cms.biz.IArticleBiz;
import net.mingsoft.cms.constant.ModelCode;
import net.mingsoft.cms.entity.ArticleEntity; import net.mingsoft.cms.entity.ArticleEntity;
import net.mingsoft.cms.util.CmsParserUtil; import net.mingsoft.cms.util.CmsParserUtil;
import net.mingsoft.mdiy.biz.IPageBiz; import net.mingsoft.mdiy.biz.IPageBiz;
...@@ -89,6 +91,7 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction { ...@@ -89,6 +91,7 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
@ExceptionHandler(java.lang.NullPointerException.class) @ExceptionHandler(java.lang.NullPointerException.class)
public void diy(@PathVariable(value = "diy") String diy, HttpServletRequest req, HttpServletResponse resp) { public void diy(@PathVariable(value = "diy") String diy, HttpServletRequest req, HttpServletResponse resp) {
Map map = BasicUtil.assemblyRequestMap(); Map map = BasicUtil.assemblyRequestMap();
map.put(ParserUtil.URL, BasicUtil.getUrl());
//动态解析 //动态解析
map.put(ParserUtil.IS_DO,true); map.put(ParserUtil.IS_DO,true);
//设置动态请求的模块路径 //设置动态请求的模块路径
...@@ -158,7 +161,8 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction { ...@@ -158,7 +161,8 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
List<ColumnArticleIdBean> columnArticles = articleBiz.queryIdsByCategoryIdForParser(typeId, null, null); List<ColumnArticleIdBean> columnArticles = articleBiz.queryIdsByCategoryIdForParser(typeId, null, null);
//判断栏目下是否有文章 //判断栏目下是否有文章
if(columnArticles.size()==0){ if(columnArticles.size()==0){
this.outJson(resp, false); this.outJson(resp, null,false,getResString("err.empty", this.getResString("typeid")));
return;
} }
map.put(ParserUtil.COLUMN, columnArticles.get(0)); map.put(ParserUtil.COLUMN, columnArticles.get(0));
//获取总数 //获取总数
...@@ -200,6 +204,10 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction { ...@@ -200,6 +204,10 @@ public class MCmsAction extends net.mingsoft.mdiy.action.BaseAction {
public void view(HttpServletRequest req, HttpServletResponse resp) { public void view(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)){
this.outJson(resp, null,false,getResString("err.empty", this.getResString("id")));
return;
}
//根据文章编号查询栏目详情模版 //根据文章编号查询栏目详情模版
ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId()); ColumnEntity column = (ColumnEntity) columnBiz.getEntity(article.getBasicCategoryId());
//解析后的内容 //解析后的内容
......
...@@ -47,7 +47,8 @@ ...@@ -47,7 +47,8 @@
<!-- 获取表字段 结束 --> <!-- 获取表字段 结束 -->
<!-- 通过视图查询返回结果集 开始 --> <!-- 通过视图查询返回结果集 开始 -->
<resultMap type="net.mingsoft.cms.bean.ColumnArticleIdBean" id="resultMapBean"> <resultMap type="net.mingsoft.cms.bean.ColumnArticleIdBean" id="resultMapBean">
<result column="ARTICLE_BASICID" property="articleId" /> <result column="ARTICLE_BASICID" property="articleId" />
<result column="column_listurl" property="columnListUrl"/><!-- 最终栏目列表地址 -->
<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="category_title" property="categoryTitle" /> <result column="category_title" property="categoryTitle" />
......
#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
\ No newline at end of file id=\u6587\u7ae0\u7f16\u53f7
typeid=\u680f\u76ee\u7f16\u53f7
...@@ -46,13 +46,13 @@ public class CmsParserUtil extends ParserUtil { ...@@ -46,13 +46,13 @@ public class CmsParserUtil extends ParserUtil {
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
map.put(IS_DO, false); map.put(IS_DO, false);
boolean mobileStyle = false; boolean mobileStyle = false;
//判断是否有移动端
if (!StringUtil.isBlank(BasicUtil.getApp().getAppMobileStyle())) {
mobileStyle = true;
}
String content = CmsParserUtil.generate(templatePath, map, mobileStyle); String content = CmsParserUtil.generate(templatePath, map, mobileStyle);
FileUtil.writeString(content, ParserUtil.buildHtmlPath(targetPath), Const.UTF8); FileUtil.writeString(content, ParserUtil.buildHtmlPath(targetPath), Const.UTF8);
//判断是否有移动端 不能将这个判断放在上面,会出现PC端一直是移动端的内容
if (!StringUtil.isBlank(BasicUtil.getApp().getAppMobileStyle())) {
mobileStyle = true;
}
// 生成移动页面 // 生成移动页面
if (mobileStyle) { if (mobileStyle) {
// 手机端m // 手机端m
......
...@@ -50,7 +50,7 @@ public class WebConfig implements WebMvcConfigurer { ...@@ -50,7 +50,7 @@ public class WebConfig implements WebMvcConfigurer {
@Override @Override
public void addResourceHandlers(ResourceHandlerRegistry registry) { public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/html/**").addResourceLocations("classpath:/html/"); registry.addResourceHandler("/html/**").addResourceLocations("/html/");
registry.addResourceHandler("/app/**").addResourceLocations("classpath:/app/"); registry.addResourceHandler("/app/**").addResourceLocations("classpath:/app/");
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/"); registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
registry.addResourceHandler("/api/**").addResourceLocations("classpath:/api/"); registry.addResourceHandler("/api/**").addResourceLocations("classpath:/api/");
......
...@@ -223,7 +223,7 @@ function clickZtreeId(event,treeId,treeNode){ ...@@ -223,7 +223,7 @@ function clickZtreeId(event,treeId,treeNode){
} }
var url="${managerPath}/mdiy/contentModel/contentModelField/"+treeNode.categoryId+"/queryField.do"; var url="${managerPath}/mdiy/contentModel/contentModelField/"+treeNode.categoryId+"/queryField.do";
var basicId="basicId=${article.basicId?c?default(0)}"; var basicId="basicId=${article.basicId?c?default(0)}";
$(this).request({url:url,data:basicId,method:"post",func:function(data) { $(this).request({url:url,data:basicId,method:"get",func:function(data) {
$("#addFieldForm").html(""); $("#addFieldForm").html("");
$("#addFieldForm").html(data); $("#addFieldForm").html(data);
}}); }});
......
<div class="ms-head"> <div class="ms-head">
<div class="head-menu"> <div class="head-menu">
<div class="head-men-left head-menu-flex-center"> <div class="head-men-left head-menu-flex-center">
<a href="{ms:global.host/}"> <a href="{ms:global.host/}/html/1/index.html">
<img src="http://cdn.mingsoft.net/images/logo.png" /> <img src="http://cdn.mingsoft.net/images/logo.png" />
</a> </a>
<ul class="head-menu-list"> <ul class="head-menu-list">
...@@ -63,8 +63,8 @@ ...@@ -63,8 +63,8 @@
<div class="head-menu-right-content" id="ms-login-vue"> <div class="head-menu-right-content" id="ms-login-vue">
<span v-show="!isLogin" style="display: none;"> <span v-show="!isLogin" style="display: none;">
<span> <span>
<a href='{ms:global.host/}/login.html'>登录</a> <a href='{ms:global.host/}/mcms/login.do'>登录</a>
</span>|<span><a href='{ms:global.host/}/register.html'>注册</a></span> </span>|<span><a href='{ms:global.host/}/mcms/register.do'>注册</a></span>
</span> </span>
<div class="topbar-info J_userInfo loginSuccess hide-default" v-show="isLogin" style="display: none;"> <div class="topbar-info J_userInfo loginSuccess hide-default" v-show="isLogin" style="display: none;">
<a class="user-name" href="{ms:global.host/}/people/center.do"> <a class="user-name" href="{ms:global.host/}/people/center.do">
......
This diff is collapsed.
...@@ -45,17 +45,19 @@ new Vue({ ...@@ -45,17 +45,19 @@ new Vue({
list: [], list: [],
}, },
methods: { methods: {
//上下页
search:function(flag){ search:function(flag){
var pageNo = {ms:search.pageNo/}; var pageNo = {ms:search.pageNo/};
var total = {ms:page.total/}; var total = {ms:page.total/};
if(flag){ if(flag){
pageNo = pageNo==total ? total : pageNo +1; pageNo = pageNo==total ? total : pageNo +1;//下一页
}else{ }else{
pageNo = pageNo -1==0 ? 1 : pageNo-1; pageNo = pageNo -1==0 ? 1 : pageNo-1;//上一页
} }
window.location.href="{ms:global.host/}/cms/1/search.do?basic_title={ms:search.basic_title/}&pageNo="+pageNo; window.location.href="{ms:global.host/}/cms/1/search.do?basic_title={ms:search.basic_title/}&pageNo="+pageNo;
window.event.returnValue=false; window.event.returnValue=false;
}, },
//首页和尾页
indexAndLast:function(pageNo){ indexAndLast:function(pageNo){
window.location.href="{ms:global.host/}/cms/1/search.do?basic_title={ms:search.basic_title/}&pageNo="+pageNo; window.location.href="{ms:global.host/}/cms/1/search.do?basic_title={ms:search.basic_title/}&pageNo="+pageNo;
window.event.returnValue=false; window.event.returnValue=false;
......
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