Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
26043a14
Commit
26043a14
authored
Nov 17, 2020
by
xierz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
appid问题
parent
ee9869ca
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
53 additions
and
7 deletions
+53
-7
pom.xml
pom.xml
+37
-0
ContentAction.java
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
+8
-4
application-test.yml
src/main/resources/application-test.yml
+7
-3
application.yml
src/main/resources/application.yml
+1
-0
No files found.
pom.xml
View file @
26043a14
...
@@ -22,10 +22,47 @@
...
@@ -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>
...
...
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
View file @
26043a14
...
@@ -12,6 +12,7 @@ import net.mingsoft.cms.biz.IContentBiz;
...
@@ -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{
...
@@ -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{
...
@@ -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{
...
@@ -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
()
+
")"
;
...
...
src/main/resources/application-test.yml
View file @
26043a14
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
:
m
cms
username
:
demo
cms
password
:
m
cms
password
:
demo
cms
filters
:
wall,mergeStat
filters
:
wall,mergeStat
type
:
com.alibaba.druid.pool.DruidDataSource
type
:
com.alibaba.druid.pool.DruidDataSource
server
:
port
:
5108
\ No newline at end of file
src/main/resources/application.yml
View file @
26043a14
...
@@ -13,6 +13,7 @@ logging:
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment