Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
26c54d41
提交
26c54d41
authored
11月 26, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: 前端改为单页面应用
上级
1ef27410
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
55 行增加
和
168 行删除
+55
-168
ShiroServiceImpl.java
.../java/io/dataease/auth/service/impl/ShiroServiceImpl.java
+0
-1
IndexController.java
...src/main/java/io/dataease/controller/IndexController.java
+3
-12
LinkServer.java
.../java/io/dataease/controller/panel/server/LinkServer.java
+7
-9
PanelLinkService.java
...main/java/io/dataease/service/panel/PanelLinkService.java
+1
-1
link.html
frontend/public/link.html
+22
-2
nolic.html
frontend/public/nolic.html
+2
-2
Link.vue
frontend/src/link/Link.vue
+0
-15
link-router.js
frontend/src/link/link-router.js
+0
-17
link.js
frontend/src/link/link.js
+0
-26
Nolic.vue
frontend/src/nolic/Nolic.vue
+0
-16
nolic-router.js
frontend/src/nolic/nolic-router.js
+0
-17
nolic.js
frontend/src/nolic/nolic.js
+0
-26
permission.js
frontend/src/permission.js
+2
-2
index.js
frontend/src/router/index.js
+7
-1
index.vue
frontend/src/views/link/index.vue
+11
-2
index.vue
frontend/src/views/nolic/index.vue
+0
-9
vue.config.js
frontend/vue.config.js
+0
-10
没有找到文件。
backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java
浏览文件 @
26c54d41
...
...
@@ -41,7 +41,6 @@ public class ShiroServiceImpl implements ShiroService {
filterChainDefinitionMap
.
put
(
"/link/**"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/index.html"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/link.html"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/xggznb/**"
,
ANON
);
//获取主题信息
...
...
backend/src/main/java/io/dataease/controller/IndexController.java
浏览文件 @
26c54d41
...
...
@@ -32,15 +32,6 @@ public class IndexController {
return
"index.html"
;
}
@GetMapping
(
"/link"
)
public
String
link
()
{
return
"link.html"
;
}
@GetMapping
(
"/test"
)
public
String
test
()
{
return
"test.html"
;
}
@GetMapping
(
"/deApi"
)
public
String
deApi
()
{
...
...
@@ -53,12 +44,12 @@ public class IndexController {
}
}
@GetMapping
(
"/
xggznb
/{index}"
)
public
String
xggznb
(
@PathVariable
(
value
=
"index"
,
required
=
true
)
Long
index
)
{
@GetMapping
(
"/
link
/{index}"
)
public
String
xggznb
(
@PathVariable
(
value
=
"index"
,
required
=
true
)
Long
index
)
{
String
url
=
panelLinkService
.
getUrlByIndex
(
index
);
HttpServletResponse
response
=
ServletUtils
.
response
();
String
param
=
url
.
substring
(
url
.
indexOf
(
"?"
)
+
1
);
Cookie
cookie
=
new
Cookie
(
"link"
,
param
);
Cookie
cookie
=
new
Cookie
(
"link"
,
param
.
split
(
"="
)[
1
]
);
response
.
addCookie
(
cookie
);
return
url
;
}
...
...
backend/src/main/java/io/dataease/controller/panel/server/LinkServer.java
浏览文件 @
26c54d41
...
...
@@ -2,7 +2,6 @@ package io.dataease.controller.panel.server;
import
io.dataease.base.domain.PanelLink
;
import
io.dataease.controller.ResultHolder
;
import
io.dataease.controller.panel.api.LinkApi
;
import
io.dataease.controller.request.chart.ChartExtRequest
;
import
io.dataease.controller.request.panel.link.*
;
...
...
@@ -17,6 +16,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.net.URLDecoder
;
import
java.util.Map
;
...
...
@@ -24,7 +24,6 @@ import java.util.Map;
public
class
LinkServer
implements
LinkApi
{
@Autowired
private
PanelLinkService
panelLinkService
;
...
...
@@ -42,12 +41,11 @@ public class LinkServer implements LinkApi {
panelLinkService
.
changeEnablePwd
(
request
);
}
@Override
public
void
resetOverTime
(
@RequestBody
OverTimeRequest
request
)
{
panelLinkService
.
overTime
(
request
);
}
@Override
...
...
@@ -61,15 +59,16 @@ public class LinkServer implements LinkApi {
}
@Override
public
ValidateDto
validate
(
@RequestBody
LinkValidateRequest
request
)
throws
Exception
{
public
ValidateDto
validate
(
@RequestBody
LinkValidateRequest
request
)
throws
Exception
{
String
link
=
request
.
getLink
();
link
=
URLDecoder
.
decode
(
link
,
"UTF-8"
);
String
json
=
panelLinkService
.
decryptParam
(
link
);
ValidateDto
dto
=
new
ValidateDto
();
String
resourceId
=
json
;
PanelLink
one
=
panelLinkService
.
findOne
(
resourceId
);
dto
.
setResourceId
(
resourceId
);
if
(
ObjectUtils
.
isEmpty
(
one
)){
if
(
ObjectUtils
.
isEmpty
(
one
))
{
dto
.
setValid
(
false
);
return
dto
;
}
...
...
@@ -91,14 +90,13 @@ public class LinkServer implements LinkApi {
}
@Override
public
Object
viewDetail
(
String
viewId
,
ChartExtRequest
requestList
)
throws
Exception
{
public
Object
viewDetail
(
String
viewId
,
ChartExtRequest
requestList
)
throws
Exception
{
return
chartViewService
.
getData
(
viewId
,
requestList
);
}
@Override
public
String
shortUrl
(
Map
<
String
,
String
>
param
)
{
public
String
shortUrl
(
Map
<
String
,
String
>
param
)
{
String
resourceId
=
param
.
get
(
"resourceId"
);
return
panelLinkService
.
getShortUrl
(
resourceId
);
}
...
...
backend/src/main/java/io/dataease/service/panel/PanelLinkService.java
浏览文件 @
26c54d41
...
...
@@ -32,7 +32,7 @@ import java.util.List;
public
class
PanelLinkService
{
private
static
final
String
BASEURL
=
"/link.html?link="
;
private
static
final
String
SHORT_URL_PREFIX
=
"/
xggznb
/"
;
private
static
final
String
SHORT_URL_PREFIX
=
"/
link
/"
;
@Resource
private
PanelLinkMapper
mapper
;
...
...
frontend/public/link.html
浏览文件 @
26c54d41
...
...
@@ -4,10 +4,30 @@
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"shortcut icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
DataEase
</title>
</head>
<body
style=
"height: 100%;"
>
<div
id=
"link"
></div>
</body>
<script>
function
getQueryVariable
(
variable
)
{
debugger
let
query
=
window
.
location
.
search
.
substring
(
1
)
let
vars
=
[]
if
(
!
query
)
{
query
=
document
.
cookie
vars
=
query
.
split
(
';'
)
}
else
{
vars
=
query
.
split
(
'&'
)
}
for
(
var
i
=
0
;
i
<
vars
.
length
;
i
++
)
{
const
pair
=
vars
[
i
].
split
(
'='
)
if
(
pair
[
0
].
trim
()
===
variable
)
{
return
pair
[
1
]
}
}
return
(
false
)
}
const
link
=
getQueryVariable
(
'link'
)
const
url
=
"/#/delink?link="
+
encodeURIComponent
(
link
)
window
.
location
.
href
=
url
</script>
</html>
frontend/public/nolic.html
浏览文件 @
26c54d41
...
...
@@ -4,10 +4,10 @@
<meta
charset=
"utf-8"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1.0"
>
<link
rel=
"shortcut icon"
href=
"<%= BASE_URL %>favicon.ico"
>
<title>
DataEase
</title>
</head>
<body
style=
"height: 100%;"
>
<div
id=
"nolic"
></div>
<div>
缺少许可
</div>
</body>
</html>
frontend/src/link/Link.vue
deleted
100644 → 0
浏览文件 @
1ef27410
<
template
>
<div
id=
"link"
style=
"height:100%;"
><router-view
/>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/link/link-router.js
deleted
100644 → 0
浏览文件 @
1ef27410
import
Vue
from
'vue'
import
Router
from
'vue-router'
Vue
.
use
(
Router
)
export
default
new
Router
({
routes
:
[
{
path
:
'/'
,
name
:
'home'
,
component
:
()
=>
import
(
'../views/link/index.vue'
),
meta
:
{
title
:
'首页'
}
}
]
})
frontend/src/link/link.js
deleted
100644 → 0
浏览文件 @
1ef27410
import
Vue
from
'vue'
import
Link
from
'./Link.vue'
import
router
from
'./link-router'
import
store
from
'../store'
import
'@/styles/index.scss'
// global css
import
i18n
from
'../lang'
// internationalization
import
ElementUI
from
'element-ui'
import
'@/components/canvas/custom-component'
// 注册自定义组件
import
widgets
from
'@/components/widget'
import
*
as
echarts
from
'echarts'
import
UmyUi
from
'umy-ui'
import
'@/utils/DateUtil'
Vue
.
use
(
UmyUi
)
Vue
.
prototype
.
$echarts
=
echarts
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
widgets
)
Vue
.
use
(
ElementUI
,
{
i18n
:
(
key
,
value
)
=>
i18n
.
t
(
key
,
value
)
})
new
Vue
({
router
,
store
,
i18n
,
render
:
h
=>
h
(
Link
)
}).
$mount
(
'#link'
)
frontend/src/nolic/Nolic.vue
deleted
100644 → 0
浏览文件 @
1ef27410
<
template
>
<div
id=
"nolic"
style=
"height:100%;"
>
<router-view
/>
</div>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
}
}
}
</
script
>
<
style
scoped
>
</
style
>
frontend/src/nolic/nolic-router.js
deleted
100644 → 0
浏览文件 @
1ef27410
import
Vue
from
'vue'
import
Router
from
'vue-router'
Vue
.
use
(
Router
)
export
default
new
Router
({
routes
:
[
{
path
:
'/'
,
name
:
'home'
,
component
:
()
=>
import
(
'../views/nolic/index.vue'
),
meta
:
{
title
:
'首页'
}
}
]
})
frontend/src/nolic/nolic.js
deleted
100644 → 0
浏览文件 @
1ef27410
import
Vue
from
'vue'
import
Nolic
from
'./Nolic.vue'
import
router
from
'./nolic-router'
import
store
from
'../store'
import
'@/styles/index.scss'
// global css
import
i18n
from
'../lang'
// internationalization
import
ElementUI
from
'element-ui'
import
'@/components/canvas/custom-component'
// 注册自定义组件
import
widgets
from
'@/components/widget'
import
*
as
echarts
from
'echarts'
import
UmyUi
from
'umy-ui'
Vue
.
use
(
UmyUi
)
Vue
.
prototype
.
$echarts
=
echarts
Vue
.
config
.
productionTip
=
false
Vue
.
use
(
widgets
)
Vue
.
use
(
ElementUI
,
{
i18n
:
(
key
,
value
)
=>
i18n
.
t
(
key
,
value
)
})
new
Vue
({
router
,
store
,
i18n
,
render
:
h
=>
h
(
Nolic
)
}).
$mount
(
'#nolic'
)
frontend/src/permission.js
浏览文件 @
26c54d41
...
...
@@ -11,7 +11,7 @@ import { filterAsyncRouter } from '@/store/modules/permission'
NProgress
.
configure
({
showSpinner
:
false
})
// NProgress Configuration
const
whiteList
=
[
'/login'
,
'/401'
,
'/404'
]
// no redirect whitelist
const
whiteList
=
[
'/login'
,
'/401'
,
'/404'
,
'/delink'
,
'/nolic'
]
// no redirect whitelist
router
.
beforeEach
(
async
(
to
,
from
,
next
)
=>
{
// start progress bar
...
...
@@ -29,7 +29,7 @@ router.beforeEach(async(to, from, next) => {
NProgress
.
done
()
}
else
{
const
hasGetUserInfo
=
store
.
getters
.
name
if
(
hasGetUserInfo
||
to
.
path
.
indexOf
(
'/preview/'
)
>
-
1
)
{
if
(
hasGetUserInfo
||
to
.
path
.
indexOf
(
'/preview/'
)
>
-
1
||
to
.
path
.
indexOf
(
'/delink'
)
>
-
1
||
to
.
path
.
indexOf
(
'/nolic'
)
>
-
1
)
{
next
()
store
.
dispatch
(
'permission/setCurrentPath'
,
to
.
path
)
}
else
{
...
...
frontend/src/router/index.js
浏览文件 @
26c54d41
...
...
@@ -71,6 +71,12 @@ export const constantRoutes = [
}
]
},
{
path
:
'/delink'
,
component
:
()
=>
import
(
'@/views/link'
),
hidden
:
true
},
{
path
:
'/preview/:reportId'
,
component
:
()
=>
import
(
'@/components/canvas/components/Editor/PreviewEject'
),
...
...
@@ -208,7 +214,7 @@ export const constantRoutes = [
]
const
createRouter
=
()
=>
new
Router
({
//
mode: 'history', // require service support
//
mode: 'history', // require service support
mode
:
'hash'
,
scrollBehavior
:
()
=>
({
y
:
0
}),
routes
:
constantRoutes
...
...
frontend/src/views/link/index.vue
浏览文件 @
26c54d41
...
...
@@ -17,6 +17,7 @@ export default {
components
:
{
LinkError
,
LinkPwd
,
LinkView
,
LinkExpire
},
data
()
{
return
{
resourceId
:
null
,
...
...
@@ -32,8 +33,16 @@ export default {
loadInit
()
{
debugger
this
.
link
=
getQueryVariable
(
this
.
PARAMKEY
)
validate
({
link
:
this
.
link
}).
then
(
res
=>
{
// this.link = getQueryVariable(this.PARAMKEY)
this
.
link
=
this
.
$route
.
query
.
link
if
(
!
this
.
link
)
{
this
.
link
=
getQueryVariable
(
this
.
PARAMKEY
)
}
if
(
!
this
.
link
)
{
this
.
showError
()
return
}
validate
({
link
:
encodeURIComponent
(
this
.
link
)
}).
then
(
res
=>
{
const
{
resourceId
,
valid
,
enablePwd
,
passPwd
,
expire
}
=
res
.
data
this
.
resourceId
=
resourceId
// 如果链接无效 直接显示无效页面
...
...
frontend/src/views/nolic/index.vue
deleted
100644 → 0
浏览文件 @
1ef27410
<
template
>
<div>
缺少许可
</div>
</
template
>
<
script
>
export
default
{
}
</
script
>
frontend/vue.config.js
浏览文件 @
26c54d41
...
...
@@ -36,16 +36,6 @@ module.exports = {
entry
:
'src/main.js'
,
template
:
'public/index.html'
,
filename
:
'index.html'
},
link
:
{
entry
:
'src/link/link.js'
,
template
:
'public/link.html'
,
filename
:
'link.html'
},
nolic
:
{
entry
:
'src/nolic/nolic.js'
,
template
:
'public/nolic.html'
,
filename
:
'nolic.html'
}
},
configureWebpack
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论