Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
99aac19d
提交
99aac19d
authored
8月 11, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 包装api接口文档
上级
92c2cbd7
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
136 行增加
和
1 行删除
+136
-1
ShiroConfig.java
...nd/src/main/java/io/dataease/auth/config/ShiroConfig.java
+1
-0
F2CDocFilter.java
...d/src/main/java/io/dataease/auth/filter/F2CDocFilter.java
+26
-0
ShiroServiceImpl.java
.../java/io/dataease/auth/service/impl/ShiroServiceImpl.java
+2
-1
IndexController.java
...src/main/java/io/dataease/controller/IndexController.java
+21
-0
nolic.html
frontend/public/nolic.html
+13
-0
Nolic.vue
frontend/src/nolic/Nolic.vue
+16
-0
nolic-router.js
frontend/src/nolic/nolic-router.js
+17
-0
nolic.js
frontend/src/nolic/nolic.js
+26
-0
index.vue
frontend/src/views/nolic/index.vue
+9
-0
vue.config.js
frontend/vue.config.js
+5
-0
没有找到文件。
backend/src/main/java/io/dataease/auth/config/ShiroConfig.java
浏览文件 @
99aac19d
...
...
@@ -51,6 +51,7 @@ public class ShiroConfig {
filterMap
.
put
(
"jwt"
,
new
JWTFilter
());
filterMap
.
put
(
"logout"
,
new
F2CLogoutFilter
());
filterMap
.
put
(
"link"
,
new
F2CLinkFilter
());
filterMap
.
put
(
"doc"
,
new
F2CDocFilter
());
factoryBean
.
setSecurityManager
(
securityManager
);
factoryBean
.
setLoginUrl
(
"/login"
);
factoryBean
.
setUnauthorizedUrl
(
"/login"
);
...
...
backend/src/main/java/io/dataease/auth/filter/F2CDocFilter.java
0 → 100644
浏览文件 @
99aac19d
package
io
.
dataease
.
auth
.
filter
;
import
org.apache.shiro.web.filter.authc.AnonymousFilter
;
import
javax.servlet.ServletException
;
import
javax.servlet.ServletRequest
;
import
javax.servlet.ServletResponse
;
import
javax.servlet.http.HttpServletRequest
;
import
java.io.IOException
;
public
class
F2CDocFilter
extends
AnonymousFilter
{
@Override
protected
boolean
onPreHandle
(
ServletRequest
request
,
ServletResponse
response
,
Object
mappedValue
)
{
HttpServletRequest
req
=
(
HttpServletRequest
)
request
;
String
path
=
"/deApi"
;
try
{
req
.
getRequestDispatcher
(
path
).
forward
(
req
,
response
);
}
catch
(
ServletException
e
)
{
e
.
printStackTrace
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
true
;
}
}
backend/src/main/java/io/dataease/auth/service/impl/ShiroServiceImpl.java
浏览文件 @
99aac19d
...
...
@@ -20,7 +20,8 @@ public class ShiroServiceImpl implements ShiroService {
// 配置过滤:不会被拦截的链接 -> 放行 start ----------------------------------------------------------
// 放行Swagger2页面,需要放行这些
filterChainDefinitionMap
.
put
(
"/doc.html"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/doc.html**"
,
"doc"
);
filterChainDefinitionMap
.
put
(
"/deApi**"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/swagger-ui.html"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/swagger-ui/**"
,
ANON
);
filterChainDefinitionMap
.
put
(
"/swagger/**"
,
ANON
);
...
...
backend/src/main/java/io/dataease/controller/IndexController.java
浏览文件 @
99aac19d
package
io
.
dataease
.
controller
;
import
io.dataease.commons.license.DefaultLicenseService
;
import
io.dataease.commons.license.F2CLicenseResponse
;
import
io.dataease.exception.DataEaseException
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
javax.annotation.Resource
;
@Controller
@RequestMapping
public
class
IndexController
{
@Resource
private
DefaultLicenseService
defaultLicenseService
;
@GetMapping
(
value
=
"/"
)
public
String
index
()
{
return
"index.html"
;
...
...
@@ -28,5 +36,18 @@ public class IndexController {
return
"test.html"
;
}
@GetMapping
(
"/deApi"
)
public
String
deApi
()
{
F2CLicenseResponse
f2CLicenseResponse
=
defaultLicenseService
.
validateLicense
();
switch
(
f2CLicenseResponse
.
getStatus
())
{
case
valid:
return
"doc.html"
;
default
:
// DataEaseException.throwException("Invalid License.");
return
"nolic.html"
;
}
// return "index.html";
}
}
frontend/public/nolic.html
0 → 100644
浏览文件 @
99aac19d
<!DOCTYPE html>
<html
lang=
"zh"
>
<head>
<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>
</body>
</html>
frontend/src/nolic/Nolic.vue
0 → 100644
浏览文件 @
99aac19d
<
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
0 → 100644
浏览文件 @
99aac19d
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
0 → 100644
浏览文件 @
99aac19d
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/views/nolic/index.vue
0 → 100644
浏览文件 @
99aac19d
<
template
>
<div>
缺少许可
</div>
</
template
>
<
script
>
export
default
{
}
</
script
>
frontend/vue.config.js
浏览文件 @
99aac19d
...
...
@@ -40,6 +40,11 @@ module.exports = {
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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论