appid问题

This commit is contained in:
xierz 2020-11-17 17:03:33 +08:00
parent ee9869ca48
commit 26043a14e6
4 changed files with 53 additions and 8 deletions

37
pom.xml
View File

@ -22,10 +22,47 @@
</properties>
<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>
<groupId>net.mingsoft</groupId>
<artifactId>ms-mpeople</artifactId>
</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可以删除掉 -->
<dependency>
<groupId>net.mingsoft</groupId>

View File

@ -12,6 +12,7 @@ import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.biz.IHistoryLogBiz;
import net.mingsoft.cms.entity.ContentEntity;
import net.mingsoft.cms.entity.HistoryLogEntity;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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")
@GetMapping(value = "/{contentId}/hit")
@ResponseBody
public String hit(@PathVariable @ApiIgnore int contentId, HttpServletRequest request, HttpServletResponse response){
if(contentId<=0){
public String hit(@PathVariable @ApiIgnore String contentId, HttpServletRequest request, HttpServletResponse response){
if(StringUtils.isEmpty(contentId)){
return "document.write(0)";
}
//获取ip
@ -113,7 +114,7 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
//获取端口移动/web..
boolean isMobileDevice = BasicUtil.isMobileDevice();
ContentEntity content = (ContentEntity)contentBiz.getEntity(contentId);
ContentEntity content = contentBiz.getById(contentId);
if(content == null){
return "document.write(0)";
}
@ -132,7 +133,10 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
entity.setContentId(content.getId());
entity.setCreateDate(new Date());
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(" + content.getContentHit() + ")";

View File

@ -1,7 +1,10 @@
spring:
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
username: mcms
password: mcms
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: democms
password: democms
filters: wall,mergeStat
type: com.alibaba.druid.pool.DruidDataSource
type: com.alibaba.druid.pool.DruidDataSource
server:
port: 5108

View File

@ -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
ms:
database: demo-cms-dev-4
# scheme: https #解决使用代理服务器代理应用时标签解析域名依旧为http的问题
swagger:
enable: true #启用swagger文档生产的时候务必关掉 访问地址http://ip|域名/项目发布名/swagger-ui.html