Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
sts网站
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liyang
sts网站
Commits
96d2b2d6
Commit
96d2b2d6
authored
Nov 16, 2021
by
若依
Committed by
Gitee
Nov 16, 2021
Browse files
Options
Browse Files
Download
Plain Diff
!368 【轻量级 PR】: 统一全局配置文件
Merge pull request !368 from XTvLi/master
parents
4e817a11
b0017136
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
5 deletions
+13
-5
CaptchaController.java
...va/com/ruoyi/web/controller/common/CaptchaController.java
+2
-5
RuoYiConfig.java
...on/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
+11
-0
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CaptchaController.java
View file @
96d2b2d6
...
@@ -6,8 +6,8 @@ import java.util.concurrent.TimeUnit;
...
@@ -6,8 +6,8 @@ import java.util.concurrent.TimeUnit;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.common.config.RuoYiConfig
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.util.FastByteArrayOutputStream
;
import
org.springframework.util.FastByteArrayOutputStream
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -36,10 +36,6 @@ public class CaptchaController
...
@@ -36,10 +36,6 @@ public class CaptchaController
@Autowired
@Autowired
private
RedisCache
redisCache
;
private
RedisCache
redisCache
;
// 验证码类型
@Value
(
"${ruoyi.captchaType}"
)
private
String
captchaType
;
@Autowired
@Autowired
private
ISysConfigService
configService
;
private
ISysConfigService
configService
;
/**
/**
...
@@ -64,6 +60,7 @@ public class CaptchaController
...
@@ -64,6 +60,7 @@ public class CaptchaController
BufferedImage
image
=
null
;
BufferedImage
image
=
null
;
// 生成验证码
// 生成验证码
String
captchaType
=
RuoYiConfig
.
getCaptchaType
();
if
(
"math"
.
equals
(
captchaType
))
if
(
"math"
.
equals
(
captchaType
))
{
{
String
capText
=
captchaProducerMath
.
createText
();
String
capText
=
captchaProducerMath
.
createText
();
...
...
ruoyi-common/src/main/java/com/ruoyi/common/config/RuoYiConfig.java
View file @
96d2b2d6
...
@@ -30,6 +30,9 @@ public class RuoYiConfig
...
@@ -30,6 +30,9 @@ public class RuoYiConfig
/** 获取地址开关 */
/** 获取地址开关 */
private
static
boolean
addressEnabled
;
private
static
boolean
addressEnabled
;
/** 验证码类型 */
private
static
String
captchaType
;
public
String
getName
()
public
String
getName
()
{
{
return
name
;
return
name
;
...
@@ -90,6 +93,14 @@ public class RuoYiConfig
...
@@ -90,6 +93,14 @@ public class RuoYiConfig
RuoYiConfig
.
addressEnabled
=
addressEnabled
;
RuoYiConfig
.
addressEnabled
=
addressEnabled
;
}
}
public
static
String
getCaptchaType
()
{
return
captchaType
;
}
public
void
setCaptchaType
(
String
captchaType
)
{
RuoYiConfig
.
captchaType
=
captchaType
;
}
/**
/**
* 获取导入上传路径
* 获取导入上传路径
*/
*/
...
...
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