Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
open-source
/
open-platform-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit c9e31fcf
authored
Dec 18, 2020
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
完成基本开发
1 parent
d58a67b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
6 deletions
src/main/java/com/glsx/controller/IndexController.java
src/main/java/com/glsx/filter/CORSFilter.java
src/main/java/com/glsx/controller/IndexController.java
View file @
c9e31fc
...
@@ -3,6 +3,7 @@ package com.glsx.controller;
...
@@ -3,6 +3,7 @@ package com.glsx.controller;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
cn.com.glsx.openplatform.service.ApiCallMgrService
;
import
cn.com.glsx.openplatform.service.ApiCallMgrService
;
import
cn.com.glsx.openplatform.service.AppDownloadMgrService
;
import
cn.com.glsx.openplatform.service.AppDownloadMgrService
;
import
cn.com.glsx.openplatform.service.CustomerMgrService
;
import
cn.com.glsx.openplatform.service.CustomerMgrService
;
...
@@ -101,8 +102,6 @@ public class IndexController {
...
@@ -101,8 +102,6 @@ public class IndexController {
}
}
@RequestMapping
(
value
=
"/getUcSummaryStatistic"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getUcSummaryStatistic"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
R
getUcSummaryStatistic
(
@RequestParam
String
customerName
)
{
public
R
getUcSummaryStatistic
(
@RequestParam
String
customerName
)
{
...
@@ -113,21 +112,21 @@ public class IndexController {
...
@@ -113,21 +112,21 @@ public class IndexController {
@RequestMapping
(
value
=
"/getUcDeviceActivationStatistic"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getUcDeviceActivationStatistic"
,
method
=
RequestMethod
.
GET
)
public
R
getUcDeviceActivationStatistic
(
@RequestParam
String
customerName
)
{
public
R
getUcDeviceActivationStatistic
(
@RequestParam
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
=
this
.
indexService
Map
<
String
,
Long
>
statisticMap
=
this
.
indexService
.
getUcDeviceActivationStatistic
(
customerName
);
.
getUcDeviceActivationStatistic
(
customerName
);
return
R
.
ok
().
data
(
statisticMap
);
return
R
.
ok
().
data
(
statisticMap
);
}
}
@RequestMapping
(
value
=
"/getUcUserActivityStatistic"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getUcUserActivityStatistic"
,
method
=
RequestMethod
.
GET
)
public
R
getUcUserActivityStatistic
(
@RequestParam
String
customerName
)
{
public
R
getUcUserActivityStatistic
(
@RequestParam
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
=
this
.
indexService
Map
<
String
,
Long
>
statisticMap
=
this
.
indexService
.
getUcUserActivityStatistic
(
customerName
);
.
getUcUserActivityStatistic
(
customerName
);
return
R
.
ok
().
data
(
statisticMap
);
return
R
.
ok
().
data
(
statisticMap
);
}
}
@RequestMapping
(
value
=
"/getUcAppDownloadStatistic"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getUcAppDownloadStatistic"
,
method
=
RequestMethod
.
GET
)
public
R
getUcAppDownloadStatistic
(
@RequestParam
String
customerName
)
{
public
R
getUcAppDownloadStatistic
(
@RequestParam
String
customerName
)
{
Map
<
String
,
Integer
>
statisticMap
=
this
.
indexService
Map
<
String
,
Long
>
statisticMap
=
this
.
indexService
.
getUcAppDownloadStatistic
(
customerName
);
.
getUcAppDownloadStatistic
(
customerName
);
return
R
.
ok
().
data
(
statisticMap
);
return
R
.
ok
().
data
(
statisticMap
);
}
}
...
...
src/main/java/com/glsx/filter/CORSFilter.java
View file @
c9e31fc
...
@@ -26,7 +26,7 @@ public class CORSFilter implements Filter {
...
@@ -26,7 +26,7 @@ public class CORSFilter implements Filter {
LOGGER
.
info
(
"当前访问来源是:{}"
,
httpServletRequest
.
getHeader
(
"Content-Type"
));
LOGGER
.
info
(
"当前访问来源是:{}"
,
httpServletRequest
.
getHeader
(
"Content-Type"
));
// 从列表中获取,可以将数据放入缓存
// 从列表中获取,可以将数据放入缓存
// String corsOriginList = PropertyConfigurer.getString("cors.origin.list.urls");
// String corsOriginList = PropertyConfigurer.getString("cors.origin.list.urls");
String
corsOriginList
=
"http://192.168.2.68:8081/ http://192.168.2.106:8081/"
;
String
corsOriginList
=
"http://192.168.2.68:8081/ http://192.168.2.106:8081/
http://192.168.2.2:8081 http://192.168.2.2:8080
"
;
LOGGER
.
info
(
"配置的来源:{}"
,
corsOriginList
);
LOGGER
.
info
(
"配置的来源:{}"
,
corsOriginList
);
if
(
StringUtils
.
isNotBlank
(
curOrigin
)
&&
corsOriginList
.
contains
(
curOrigin
))
{
if
(
StringUtils
.
isNotBlank
(
curOrigin
)
&&
corsOriginList
.
contains
(
curOrigin
))
{
httpServletResponse
.
setHeader
(
"Access-Control-Allow-Origin"
,
curOrigin
);
httpServletResponse
.
setHeader
(
"Access-Control-Allow-Origin"
,
curOrigin
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment