Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
8688d6d9
Commit
8688d6d9
authored
Jun 11, 2019
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除swagger开关
parent
14c52954
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
8 additions
and
74 deletions
+8
-74
guns-sys/src/main/java/cn/stylefeng/guns/sys/config/web/WebConfig.java
+3
-10
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/Const.java
+1
-6
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/properties/GunsProperties.java
+3
-2
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/util/ApiMenuFilter.java
+0
-52
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/UserService.java
+1
-3
guns-vip-main/src/main/resources/application.yml
+0
-1
No files found.
guns-sys/src/main/java/cn/stylefeng/guns/sys/config/web/WebConfig.java
View file @
8688d6d9
...
...
@@ -19,7 +19,6 @@ import cn.stylefeng.guns.sys.core.attribute.AttributeSetInteceptor;
import
cn.stylefeng.guns.sys.core.constant.Const
;
import
cn.stylefeng.guns.sys.core.exception.page.GunsErrorView
;
import
cn.stylefeng.guns.sys.core.listener.ConfigListener
;
import
cn.stylefeng.guns.sys.core.properties.GunsProperties
;
import
cn.stylefeng.guns.sys.modular.api.aop.RestApiInteceptor
;
import
cn.stylefeng.roses.core.xss.XssFilter
;
import
com.alibaba.druid.pool.DruidDataSource
;
...
...
@@ -32,7 +31,6 @@ import com.google.code.kaptcha.util.Config;
import
org.springframework.aop.Advisor
;
import
org.springframework.aop.support.DefaultPointcutAdvisor
;
import
org.springframework.aop.support.JdkRegexpMethodPointcut
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.boot.web.servlet.ServletListenerRegistrationBean
;
import
org.springframework.boot.web.servlet.ServletRegistrationBean
;
...
...
@@ -54,20 +52,15 @@ import java.util.Properties;
@Configuration
public
class
WebConfig
implements
WebMvcConfigurer
{
@Autowired
private
GunsProperties
gunsProperties
;
/**
* 静态资源映射
*/
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
if
(
gunsProperties
.
getSwaggerOpen
())
{
//swagger
registry
.
addResourceHandler
(
"swagger-ui.html"
).
addResourceLocations
(
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/webjars/**"
).
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
}
//swagger
registry
.
addResourceHandler
(
"swagger-ui.html"
).
addResourceLocations
(
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/webjars/**"
).
addResourceLocations
(
"classpath:/META-INF/resources/webjars/"
);
//本应用
registry
.
addResourceHandler
(
"/assets/**"
).
addResourceLocations
(
"classpath:/assets/"
);
...
...
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/Const.java
View file @
8688d6d9
...
...
@@ -38,7 +38,7 @@ public interface Const {
String
DEFAULT_WELCOME_TIP
=
"欢迎使用Guns快速开发平台!"
;
/**
*
系统默认的管理员
密码
*
重置
密码
*/
String
DEFAULT_PWD
=
"111111"
;
...
...
@@ -58,11 +58,6 @@ public interface Const {
Long
ADMIN_ROLE_ID
=
1L
;
/**
* 接口文档的菜单名
*/
String
API_MENU_NAME
=
"接口文档"
;
/**
* 不需要权限验证的资源表达式
*/
List
<
String
>
NONE_PERMISSION_RES
=
CollectionUtil
.
newLinkedList
(
"/assets/**"
,
"/gunsApi/**"
,
"/login"
,
"/global/sessionError"
,
"/kaptcha"
,
"/error"
,
"/global/error"
,
"/oauth/**"
);
...
...
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/properties/GunsProperties.java
View file @
8688d6d9
...
...
@@ -35,8 +35,6 @@ public class GunsProperties {
private
Boolean
kaptchaOpen
=
false
;
private
Boolean
swaggerOpen
=
false
;
private
String
fileUploadPath
;
private
Boolean
haveCreatePath
=
false
;
...
...
@@ -54,14 +52,17 @@ public class GunsProperties {
private
Integer
sessionValidationInterval
=
15
*
60
;
public
String
getFileUploadPath
()
{
//如果没有写文件上传路径,保存到临时目录
if
(
ToolUtil
.
isEmpty
(
fileUploadPath
))
{
return
getTempPath
();
}
else
{
//判断有没有结尾符,没有得加上
if
(!
fileUploadPath
.
endsWith
(
File
.
separator
))
{
fileUploadPath
=
fileUploadPath
+
File
.
separator
;
}
//判断目录存不存在,不存在得加上
if
(!
haveCreatePath
)
{
File
file
=
new
File
(
fileUploadPath
);
...
...
guns-sys/src/main/java/cn/stylefeng/guns/sys/core/util/ApiMenuFilter.java
deleted
100644 → 0
View file @
14c52954
/**
* Copyright 2018-2020 stylefeng & fengshuonan (https://gitee.com/stylefeng)
* <p>
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* <p>
* http://www.apache.org/licenses/LICENSE-2.0
* <p>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
cn
.
stylefeng
.
guns
.
sys
.
core
.
util
;
import
cn.stylefeng.guns.base.pojo.node.MenuNode
;
import
cn.stylefeng.guns.sys.core.constant.Const
;
import
cn.stylefeng.guns.sys.core.properties.GunsProperties
;
import
cn.stylefeng.roses.core.util.SpringContextHolder
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* api接口文档显示过滤
*
* @author fengshuonan
* @date 2017-08-17 16:55
*/
public
class
ApiMenuFilter
extends
MenuNode
{
public
static
List
<
MenuNode
>
build
(
List
<
MenuNode
>
nodes
)
{
//如果关闭了接口文档,则不显示接口文档菜单
GunsProperties
gunsProperties
=
SpringContextHolder
.
getBean
(
GunsProperties
.
class
);
if
(!
gunsProperties
.
getSwaggerOpen
())
{
List
<
MenuNode
>
menuNodesCopy
=
new
ArrayList
<>();
for
(
MenuNode
menuNode
:
nodes
)
{
if
(
Const
.
API_MENU_NAME
.
equals
(
menuNode
.
getName
()))
{
continue
;
}
else
{
menuNodesCopy
.
add
(
menuNode
);
}
}
nodes
=
menuNodesCopy
;
}
return
nodes
;
}
}
guns-sys/src/main/java/cn/stylefeng/guns/sys/modular/system/service/UserService.java
View file @
8688d6d9
...
...
@@ -11,7 +11,6 @@ import cn.stylefeng.guns.sys.core.constant.state.ManagerStatus;
import
cn.stylefeng.guns.sys.core.exception.enums.BizExceptionEnum
;
import
cn.stylefeng.guns.sys.core.shiro.ShiroKit
;
import
cn.stylefeng.guns.sys.core.shiro.service.UserAuthService
;
import
cn.stylefeng.guns.sys.core.util.ApiMenuFilter
;
import
cn.stylefeng.guns.sys.modular.system.entity.User
;
import
cn.stylefeng.guns.sys.modular.system.factory.UserFactory
;
import
cn.stylefeng.guns.sys.modular.system.mapper.UserMapper
;
...
...
@@ -177,8 +176,7 @@ public class UserService extends ServiceImpl<UserMapper, User> {
return
new
ArrayList
<>();
}
else
{
List
<
MenuNode
>
menus
=
menuService
.
getMenusByRoleIds
(
roleList
);
List
<
MenuNode
>
titles
=
MenuNode
.
buildTitle
(
menus
);
return
ApiMenuFilter
.
build
(
titles
);
return
MenuNode
.
buildTitle
(
menus
);
}
}
...
...
guns-vip-main/src/main/resources/application.yml
View file @
8688d6d9
...
...
@@ -3,7 +3,6 @@ server:
max-http-header-size
:
10240
guns
:
swagger-open
:
true
#是否开启swagger (true/false)
kaptcha-open
:
false
#是否开启登录时验证码 (true/false)
spring-session-open
:
false
#是否开启spring session,如果是多机环境需要开启(true/false)
session-invalidate-time
:
1800
#session失效时间(只在单机环境下生效,多机环境在SpringSessionConfig类中配置) 单位:秒
...
...
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