Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
995fe082
提交
995fe082
authored
2月 16, 2022
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: nginx前后分离部署
上级
abe6f072
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
59 行增加
和
16 行删除
+59
-16
pom.xml
backend/pom.xml
+26
-0
IndexController.java
...src/main/java/io/dataease/controller/IndexController.java
+1
-3
PanelLinkService.java
...main/java/io/dataease/service/panel/PanelLinkService.java
+15
-11
application-stage.properties
backend/src/main/resources/application-stage.properties
+2
-0
application-whole.properties
backend/src/main/resources/application-whole.properties
+2
-0
application.properties
backend/src/main/resources/application.properties
+1
-0
.env.staging
frontend/.env.staging
+1
-1
request.js
frontend/src/utils/request.js
+1
-1
.env.staging
mobile/.env.staging
+8
-0
package.json
mobile/package.json
+2
-0
没有找到文件。
backend/pom.xml
浏览文件 @
995fe082
...
@@ -407,6 +407,22 @@
...
@@ -407,6 +407,22 @@
</dependencies>
</dependencies>
</plugin>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>
whole
</id>
<properties>
<profiles.active>
whole
</profiles.active>
</properties>
<activation>
<activeByDefault>
true
</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
<plugin>
<groupId>
org.apache.maven.plugins
</groupId>
<groupId>
org.apache.maven.plugins
</groupId>
<artifactId>
maven-antrun-plugin
</artifactId>
<artifactId>
maven-antrun-plugin
</artifactId>
...
@@ -448,6 +464,16 @@
...
@@ -448,6 +464,16 @@
</plugin>
</plugin>
</plugins>
</plugins>
</build>
</build>
</profile>
<profile>
<id>
stage
</id>
<properties>
<profiles.active>
stage
</profiles.active>
</properties>
</profile>
</profiles>
<repositories>
<repositories>
<repository>
<repository>
...
...
backend/src/main/java/io/dataease/controller/IndexController.java
浏览文件 @
995fe082
...
@@ -53,7 +53,7 @@ public class IndexController {
...
@@ -53,7 +53,7 @@ public class IndexController {
String
url
;
String
url
;
if
(
CodingUtil
.
isNumeric
(
index
))
{
if
(
CodingUtil
.
isNumeric
(
index
))
{
url
=
panelLinkService
.
getUrlByIndex
(
Long
.
parseLong
(
index
));
url
=
panelLinkService
.
getUrlByIndex
(
Long
.
parseLong
(
index
));
}
else
{
}
else
{
url
=
panelLinkService
.
getUrlByUuid
(
index
);
url
=
panelLinkService
.
getUrlByUuid
(
index
);
}
}
HttpServletResponse
response
=
ServletUtils
.
response
();
HttpServletResponse
response
=
ServletUtils
.
response
();
...
@@ -65,8 +65,6 @@ public class IndexController {
...
@@ -65,8 +65,6 @@ public class IndexController {
}
}
}
}
@GetMapping
(
"/tempMobileLink/{id}/{token}"
)
@GetMapping
(
"/tempMobileLink/{id}/{token}"
)
public
void
tempMobileLink
(
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
"token"
)
String
token
)
{
public
void
tempMobileLink
(
@PathVariable
(
"id"
)
String
id
,
@PathVariable
(
"token"
)
String
token
)
{
String
url
=
"/#preview/"
+
id
;
String
url
=
"/#preview/"
+
id
;
...
...
backend/src/main/java/io/dataease/service/panel/PanelLinkService.java
浏览文件 @
995fe082
...
@@ -8,7 +8,6 @@ import io.dataease.base.mapper.PanelGroupMapper;
...
@@ -8,7 +8,6 @@ import io.dataease.base.mapper.PanelGroupMapper;
import
io.dataease.base.mapper.PanelLinkMapper
;
import
io.dataease.base.mapper.PanelLinkMapper
;
import
io.dataease.base.mapper.PanelLinkMappingMapper
;
import
io.dataease.base.mapper.PanelLinkMappingMapper
;
import
io.dataease.base.mapper.ext.ExtPanelLinkMapper
;
import
io.dataease.base.mapper.ext.ExtPanelLinkMapper
;
import
io.dataease.commons.exception.DEException
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.AuthUtils
;
import
io.dataease.commons.utils.CodingUtil
;
import
io.dataease.commons.utils.CodingUtil
;
import
io.dataease.commons.utils.ServletUtils
;
import
io.dataease.commons.utils.ServletUtils
;
...
@@ -20,6 +19,7 @@ import io.dataease.dto.panel.link.GenerateDto;
...
@@ -20,6 +19,7 @@ import io.dataease.dto.panel.link.GenerateDto;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -27,7 +27,6 @@ import javax.annotation.Resource;
...
@@ -27,7 +27,6 @@ import javax.annotation.Resource;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
@Service
@Service
public
class
PanelLinkService
{
public
class
PanelLinkService
{
...
@@ -36,6 +35,9 @@ public class PanelLinkService {
...
@@ -36,6 +35,9 @@ public class PanelLinkService {
private
static
final
String
USERPARAM
=
"&user="
;
private
static
final
String
USERPARAM
=
"&user="
;
private
static
final
String
SHORT_URL_PREFIX
=
"/link/"
;
private
static
final
String
SHORT_URL_PREFIX
=
"/link/"
;
@Value
(
"${server.servlet.context-path}"
)
private
String
contextPath
;
@Resource
@Resource
private
PanelLinkMapper
mapper
;
private
PanelLinkMapper
mapper
;
@Resource
@Resource
...
@@ -60,7 +62,7 @@ public class PanelLinkService {
...
@@ -60,7 +62,7 @@ public class PanelLinkService {
panelLinkMappingMapper
.
updateByExampleSelective
(
mapping
,
example
);
panelLinkMappingMapper
.
updateByExampleSelective
(
mapping
,
example
);
}
}
private
PanelLinkExample
example
(
String
panelLinkId
,
Long
userId
){
private
PanelLinkExample
example
(
String
panelLinkId
,
Long
userId
)
{
PanelLinkExample
example
=
new
PanelLinkExample
();
PanelLinkExample
example
=
new
PanelLinkExample
();
example
.
createCriteria
().
andResourceIdEqualTo
(
panelLinkId
).
andUserIdEqualTo
(
userId
);
example
.
createCriteria
().
andResourceIdEqualTo
(
panelLinkId
).
andUserIdEqualTo
(
userId
);
return
example
;
return
example
;
...
@@ -93,13 +95,13 @@ public class PanelLinkService {
...
@@ -93,13 +95,13 @@ public class PanelLinkService {
}
}
public
PanelLink
findOne
(
String
resourceId
,
Long
userId
)
{
public
PanelLink
findOne
(
String
resourceId
,
Long
userId
)
{
if
(
userId
==
null
)
{
if
(
userId
==
null
)
{
return
findOne
(
resourceId
);
return
findOne
(
resourceId
);
}
}
List
<
PanelLink
>
panelLinks
=
mapper
.
selectByExample
(
example
(
resourceId
,
userId
));
List
<
PanelLink
>
panelLinks
=
mapper
.
selectByExample
(
example
(
resourceId
,
userId
));
if
(
CollectionUtils
.
isNotEmpty
(
panelLinks
))
{
if
(
CollectionUtils
.
isNotEmpty
(
panelLinks
))
{
return
panelLinks
.
get
(
0
);
return
panelLinks
.
get
(
0
);
}
else
{
}
else
{
return
null
;
return
null
;
}
}
}
}
...
@@ -152,8 +154,8 @@ public class PanelLinkService {
...
@@ -152,8 +154,8 @@ public class PanelLinkService {
private
String
buildLinkParam
(
PanelLink
link
)
{
private
String
buildLinkParam
(
PanelLink
link
)
{
String
linkParam
=
encrypt
(
link
.
getResourceId
());
String
linkParam
=
encrypt
(
link
.
getResourceId
());
if
(
link
.
getUserId
()
!=
null
)
{
if
(
link
.
getUserId
()
!=
null
)
{
linkParam
=
linkParam
+
USERPARAM
+
link
.
getUserId
().
toString
();
linkParam
=
linkParam
+
USERPARAM
+
link
.
getUserId
().
toString
();
}
}
return
linkParam
;
return
linkParam
;
}
}
...
@@ -172,7 +174,8 @@ public class PanelLinkService {
...
@@ -172,7 +174,8 @@ public class PanelLinkService {
public
Boolean
validateHeads
(
PanelLink
panelLink
)
throws
Exception
{
public
Boolean
validateHeads
(
PanelLink
panelLink
)
throws
Exception
{
HttpServletRequest
request
=
ServletUtils
.
request
();
HttpServletRequest
request
=
ServletUtils
.
request
();
String
token
=
request
.
getHeader
(
"LINK-PWD-TOKEN"
);
String
token
=
request
.
getHeader
(
"LINK-PWD-TOKEN"
);
if
(!
panelLink
.
getEnablePwd
()
||
StringUtils
.
isEmpty
(
token
)
||
StringUtils
.
equals
(
"undefined"
,
token
)
||
StringUtils
.
equals
(
"null"
,
token
))
{
if
(!
panelLink
.
getEnablePwd
()
||
StringUtils
.
isEmpty
(
token
)
||
StringUtils
.
equals
(
"undefined"
,
token
)
||
StringUtils
.
equals
(
"null"
,
token
))
{
String
resourceId
=
panelLink
.
getResourceId
();
String
resourceId
=
panelLink
.
getResourceId
();
String
pwd
=
"dataease"
;
String
pwd
=
"dataease"
;
String
tk
=
JWTUtils
.
signLink
(
resourceId
,
panelLink
.
getUserId
(),
pwd
);
String
tk
=
JWTUtils
.
signLink
(
resourceId
,
panelLink
.
getUserId
(),
pwd
);
...
@@ -181,7 +184,8 @@ public class PanelLinkService {
...
@@ -181,7 +184,8 @@ public class PanelLinkService {
httpServletResponse
.
setHeader
(
"LINK-PWD-TOKEN"
,
tk
);
httpServletResponse
.
setHeader
(
"LINK-PWD-TOKEN"
,
tk
);
return
false
;
return
false
;
}
}
if
(
StringUtils
.
isEmpty
(
panelLink
.
getPwd
()))
return
false
;
if
(
StringUtils
.
isEmpty
(
panelLink
.
getPwd
()))
return
false
;
return
JWTUtils
.
verifyLink
(
token
,
panelLink
.
getResourceId
(),
panelLink
.
getUserId
(),
panelLink
.
getPwd
());
return
JWTUtils
.
verifyLink
(
token
,
panelLink
.
getResourceId
(),
panelLink
.
getUserId
(),
panelLink
.
getPwd
());
}
}
...
@@ -218,7 +222,7 @@ public class PanelLinkService {
...
@@ -218,7 +222,7 @@ public class PanelLinkService {
List
<
PanelLinkMapping
>
mappings
=
panelLinkMappingMapper
.
selectByExample
(
example
);
List
<
PanelLinkMapping
>
mappings
=
panelLinkMappingMapper
.
selectByExample
(
example
);
PanelLinkMapping
mapping
=
mappings
.
get
(
0
);
PanelLinkMapping
mapping
=
mappings
.
get
(
0
);
String
uuid
=
mapping
.
getUuid
();
String
uuid
=
mapping
.
getUuid
();
return
SHORT_URL_PREFIX
+
(
StringUtils
.
isBlank
(
uuid
)
?
mapping
.
getId
()
:
uuid
);
return
contextPath
+
SHORT_URL_PREFIX
+
(
StringUtils
.
isBlank
(
uuid
)
?
mapping
.
getId
()
:
uuid
);
}
}
public
String
getUrlByIndex
(
Long
index
)
{
public
String
getUrlByIndex
(
Long
index
)
{
...
...
backend/src/main/resources/application-stage.properties
0 → 100644
浏览文件 @
995fe082
server.servlet.context-path
=
/de-api
\ No newline at end of file
backend/src/main/resources/application-whole.properties
0 → 100644
浏览文件 @
995fe082
server.servlet.context-path
=
\ No newline at end of file
backend/src/main/resources/application.properties
浏览文件 @
995fe082
spring.profiles.active
=
@profiles.active@
spring.application.name
=
dataease
spring.application.name
=
dataease
server.port
=
8081
server.port
=
8081
...
...
frontend/.env.staging
浏览文件 @
995fe082
...
@@ -4,5 +4,5 @@ NODE_ENV = production
...
@@ -4,5 +4,5 @@ NODE_ENV = production
ENV = 'staging'
ENV = 'staging'
# base api
# base api
VUE_APP_BASE_API = '/
stage-api
'
VUE_APP_BASE_API = '/
de-api/
'
frontend/src/utils/request.js
浏览文件 @
995fe082
...
@@ -14,7 +14,7 @@ import Cookies from 'js-cookie'
...
@@ -14,7 +14,7 @@ import Cookies from 'js-cookie'
const
getTimeOut
=
()
=>
{
const
getTimeOut
=
()
=>
{
let
time
=
10
let
time
=
10
const
url
=
'/
system/requestTimeOut'
const
url
=
process
.
env
.
VUE_APP_BASE_API
+
'
system/requestTimeOut'
const
xhr
=
new
XMLHttpRequest
()
const
xhr
=
new
XMLHttpRequest
()
xhr
.
onreadystatechange
=
()
=>
{
xhr
.
onreadystatechange
=
()
=>
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
...
...
mobile/.env.staging
0 → 100644
浏览文件 @
995fe082
NODE_ENV = production
# just a flag
ENV = 'staging'
# base api
VUE_APP_BASE_API = '/de-api/'
mobile/package.json
浏览文件 @
995fe082
...
@@ -5,6 +5,8 @@
...
@@ -5,6 +5,8 @@
"scripts"
:
{
"scripts"
:
{
"serve"
:
"npm run dev:h5"
,
"serve"
:
"npm run dev:h5"
,
"build"
:
"npm run build:h5"
,
"build"
:
"npm run build:h5"
,
"build:stage"
:
"npm run build:h5:stage"
,
"build:h5:stage"
:
"cross-env NODE_ENV=production UNI_PLATFORM=h5 UNI_OUTPUT_DIR=dist vue-cli-service uni-build --mode staging"
,
"build:app-plus"
:
"cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build"
,
"build:app-plus"
:
"cross-env NODE_ENV=production UNI_PLATFORM=app-plus vue-cli-service uni-build"
,
"build:custom"
:
"cross-env NODE_ENV=production uniapp-cli custom"
,
"build:custom"
:
"cross-env NODE_ENV=production uniapp-cli custom"
,
"build:h5"
:
"cross-env NODE_ENV=production UNI_PLATFORM=h5 UNI_OUTPUT_DIR=dist vue-cli-service uni-build"
,
"build:h5"
:
"cross-env NODE_ENV=production UNI_PLATFORM=h5 UNI_OUTPUT_DIR=dist vue-cli-service uni-build"
,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论