diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
index 04f71629a..e39ec2cd5 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysConfigController.java
@@ -2,6 +2,8 @@ package com.ruoyi.web.controller.system;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
+
+import com.ruoyi.common.core.redis.RedisCache;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
@@ -23,9 +25,11 @@ import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.SysConfig;
import com.ruoyi.system.service.ISysConfigService;
+import static com.ruoyi.common.constant.Constants.SYS_CONFIG_KEY;
+
/**
* 参数配置 信息操作处理
- *
+ *
* @author ruoyi
*/
@RestController
@@ -35,6 +39,10 @@ public class SysConfigController extends BaseController
@Autowired
private ISysConfigService configService;
+
+ @Autowired
+ private RedisCache redisCache;
+
/**
* 获取参数配置列表
*/
@@ -76,6 +84,16 @@ public class SysConfigController extends BaseController
return AjaxResult.success(configService.selectConfigByKey(configKey));
}
+ /**
+ * 查询注册配置
+ */
+ @GetMapping(value = "/getRegisterConfig")
+ public AjaxResult getRegisterConfig()
+ {
+ String register = redisCache.getCacheObject(SYS_CONFIG_KEY + "sys.account.registerUser").toString();
+ return AjaxResult.success(register);
+ }
+
/**
* 新增参数配置
*/
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
index 58dd02ad0..c3c2e18cb 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
@@ -20,7 +20,7 @@ import com.ruoyi.framework.security.handle.LogoutSuccessHandlerImpl;
/**
* spring security配置
- *
+ *
* @author ruoyi
*/
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
@@ -31,7 +31,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/
@Autowired
private UserDetailsService userDetailsService;
-
+
/**
* 认证失败处理类
*/
@@ -49,13 +49,13 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
*/
@Autowired
private JwtAuthenticationTokenFilter authenticationTokenFilter;
-
+
/**
* 跨域过滤器
*/
@Autowired
private CorsFilter corsFilter;
-
+
/**
* 解决 无法直接注入 AuthenticationManager
*
@@ -97,7 +97,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.authorizeRequests()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
- .antMatchers("/login", "/register", "/captchaImage").anonymous()
+ .antMatchers("/login", "/register", "/captchaImage", "/system/config/getRegisterConfig").anonymous()
.antMatchers(
HttpMethod.GET,
"/",
diff --git a/ruoyi-ui/src/api/login.js b/ruoyi-ui/src/api/login.js
index 26742e79c..5d823f899 100644
--- a/ruoyi-ui/src/api/login.js
+++ b/ruoyi-ui/src/api/login.js
@@ -1,59 +1,70 @@
-import request from '@/utils/request'
-
-// 登录方法
-export function login(username, password, code, uuid) {
- const data = {
- username,
- password,
- code,
- uuid
- }
- return request({
- url: '/login',
- headers: {
- isToken: false
- },
- method: 'post',
- data: data
- })
-}
-
-// 注册方法
-export function register(data) {
- return request({
- url: '/register',
- headers: {
- isToken: false
- },
- method: 'post',
- data: data
- })
-}
-
-// 获取用户详细信息
-export function getInfo() {
- return request({
- url: '/getInfo',
- method: 'get'
- })
-}
-
-// 退出方法
-export function logout() {
- return request({
- url: '/logout',
- method: 'post'
- })
-}
-
-// 获取验证码
-export function getCodeImg() {
- return request({
- url: '/captchaImage',
- headers: {
- isToken: false
- },
- method: 'get',
- timeout: 20000
- })
-}
\ No newline at end of file
+import request from '@/utils/request'
+
+// 登录方法
+export function login(username, password, code, uuid) {
+ const data = {
+ username,
+ password,
+ code,
+ uuid
+ }
+ return request({
+ url: '/login',
+ headers: {
+ isToken: false
+ },
+ method: 'post',
+ data: data
+ })
+}
+
+// 注册方法
+export function register(data) {
+ return request({
+ url: '/register',
+ headers: {
+ isToken: false
+ },
+ method: 'post',
+ data: data
+ })
+}
+
+// 注册配置获取
+export function registerConfig() {
+ return request({
+ url: '/system/config/getRegisterConfig',
+ headers: {
+ isToken: false
+ },
+ method: 'get'
+ })
+}
+
+// 获取用户详细信息
+export function getInfo() {
+ return request({
+ url: '/getInfo',
+ method: 'get'
+ })
+}
+
+// 退出方法
+export function logout() {
+ return request({
+ url: '/logout',
+ method: 'post'
+ })
+}
+
+// 获取验证码
+export function getCodeImg() {
+ return request({
+ url: '/captchaImage',
+ headers: {
+ isToken: false
+ },
+ method: 'get',
+ timeout: 20000
+ })
+}
diff --git a/ruoyi-ui/src/views/login.vue b/ruoyi-ui/src/views/login.vue
index 6e240dd24..f393d6cd3 100644
--- a/ruoyi-ui/src/views/login.vue
+++ b/ruoyi-ui/src/views/login.vue
@@ -1,219 +1,228 @@
-
-
-
- 若依后台管理系统
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
![]()
-
-
- 记住密码
-
-
- 登 录
- 登 录 中...
-
-
- 立即注册
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ 若依后台管理系统
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
![]()
+
+
+ 记住密码
+
+
+ 登 录
+ 登 录 中...
+
+
+ 立即注册
+
+
+
+
+
+
+
+
+
+
+