appid问题
This commit is contained in:
parent
ee9869ca48
commit
26043a14e6
37
pom.xml
37
pom.xml
|
@ -22,10 +22,47 @@
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-ad</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-clean</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-mattention</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-mcomment</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-mpay</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-msend</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.mingsoft</groupId>
|
<groupId>net.mingsoft</groupId>
|
||||||
<artifactId>ms-mpeople</artifactId>
|
<artifactId>ms-mpeople</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-quartz</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-spider</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.mingsoft</groupId>
|
||||||
|
<artifactId>ms-mweixin</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
|
<!-- 此部分是铭飞平台MStroe的客户端(MStore不在铭飞开源产品范围),如果不需要使用MStore可以删除掉 -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.mingsoft</groupId>
|
<groupId>net.mingsoft</groupId>
|
||||||
|
|
|
@ -12,6 +12,7 @@ import net.mingsoft.cms.biz.IContentBiz;
|
||||||
import net.mingsoft.cms.biz.IHistoryLogBiz;
|
import net.mingsoft.cms.biz.IHistoryLogBiz;
|
||||||
import net.mingsoft.cms.entity.ContentEntity;
|
import net.mingsoft.cms.entity.ContentEntity;
|
||||||
import net.mingsoft.cms.entity.HistoryLogEntity;
|
import net.mingsoft.cms.entity.HistoryLogEntity;
|
||||||
|
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.ui.ModelMap;
|
import org.springframework.ui.ModelMap;
|
||||||
|
@ -104,8 +105,8 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
|
||||||
@ApiImplicitParam(name = "contentId", value = "文章编号", required = true,paramType="path")
|
@ApiImplicitParam(name = "contentId", value = "文章编号", required = true,paramType="path")
|
||||||
@GetMapping(value = "/{contentId}/hit")
|
@GetMapping(value = "/{contentId}/hit")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public String hit(@PathVariable @ApiIgnore int contentId, HttpServletRequest request, HttpServletResponse response){
|
public String hit(@PathVariable @ApiIgnore String contentId, HttpServletRequest request, HttpServletResponse response){
|
||||||
if(contentId<=0){
|
if(StringUtils.isEmpty(contentId)){
|
||||||
return "document.write(0)";
|
return "document.write(0)";
|
||||||
}
|
}
|
||||||
//获取ip
|
//获取ip
|
||||||
|
@ -113,7 +114,7 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
|
||||||
//获取端口(移动/web..)
|
//获取端口(移动/web..)
|
||||||
boolean isMobileDevice = BasicUtil.isMobileDevice();
|
boolean isMobileDevice = BasicUtil.isMobileDevice();
|
||||||
|
|
||||||
ContentEntity content = (ContentEntity)contentBiz.getEntity(contentId);
|
ContentEntity content = contentBiz.getById(contentId);
|
||||||
if(content == null){
|
if(content == null){
|
||||||
return "document.write(0)";
|
return "document.write(0)";
|
||||||
}
|
}
|
||||||
|
@ -132,7 +133,10 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
|
||||||
entity.setContentId(content.getId());
|
entity.setContentId(content.getId());
|
||||||
entity.setCreateDate(new Date());
|
entity.setCreateDate(new Date());
|
||||||
historyLogBiz.saveEntity(entity);
|
historyLogBiz.saveEntity(entity);
|
||||||
if(content.getAppId() == null || content.getAppId() != BasicUtil.getApp().getAppId()){
|
// 单站点不存在appid
|
||||||
|
if(content.getAppId() == null ){
|
||||||
|
return "document.write(" + content.getContentHit() + ")";
|
||||||
|
}else if(content.getAppId() != BasicUtil.getApp().getAppId()){
|
||||||
return "document.write(0)";
|
return "document.write(0)";
|
||||||
}
|
}
|
||||||
return "document.write(" + content.getContentHit() + ")";
|
return "document.write(" + content.getContentHit() + ")";
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
spring:
|
spring:
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://192.168.0.8:3316/mcms-5.2?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
url: jdbc:mysql://192.168.0.8:3316/demo-cms-dev-4?autoReconnect=true&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&serverTimezone=Asia/Shanghai
|
||||||
username: mcms
|
username: democms
|
||||||
password: mcms
|
password: democms
|
||||||
filters: wall,mergeStat
|
filters: wall,mergeStat
|
||||||
type: com.alibaba.druid.pool.DruidDataSource
|
type: com.alibaba.druid.pool.DruidDataSource
|
||||||
|
|
||||||
|
server:
|
||||||
|
port: 5108
|
|
@ -13,6 +13,7 @@ logging:
|
||||||
path: log #会在项目的根目录下生成log目录,里面会生成对应的日期目录,日期目录下面生成日志压缩包备份文件,默认按每10M分割一个日志文件,例如:log/2020-01/app-2020-01-03-18.1.log.gz(表示2020年1月3号下午六点的第一个备份),也可以根据实际情况写绝对路径,例如:d:/log
|
path: log #会在项目的根目录下生成log目录,里面会生成对应的日期目录,日期目录下面生成日志压缩包备份文件,默认按每10M分割一个日志文件,例如:log/2020-01/app-2020-01-03-18.1.log.gz(表示2020年1月3号下午六点的第一个备份),也可以根据实际情况写绝对路径,例如:d:/log
|
||||||
|
|
||||||
ms:
|
ms:
|
||||||
|
database: demo-cms-dev-4
|
||||||
# scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题
|
# scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题
|
||||||
swagger:
|
swagger:
|
||||||
enable: true #启用swagger文档,生产的时候务必关掉 访问地址:http://ip|域名/项目发布名/swagger-ui.html
|
enable: true #启用swagger文档,生产的时候务必关掉 访问地址:http://ip|域名/项目发布名/swagger-ui.html
|
||||||
|
|
Loading…
Reference in New Issue