Pre Merge pull request !423 from Xiaojiuc/master
This commit is contained in:
commit
5630d73209
@ -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,6 +25,8 @@ 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;
|
||||
|
||||
/**
|
||||
* 参数配置 信息操作处理
|
||||
*
|
||||
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增参数配置
|
||||
*/
|
||||
|
@ -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,
|
||||
"/",
|
||||
|
@ -30,6 +30,17 @@ export function register(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 注册配置获取
|
||||
export function registerConfig() {
|
||||
return request({
|
||||
url: '/system/config/getRegisterConfig',
|
||||
headers: {
|
||||
isToken: false
|
||||
},
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取用户详细信息
|
||||
export function getInfo() {
|
||||
return request({
|
||||
|
@ -62,7 +62,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCodeImg } from "@/api/login";
|
||||
import { getCodeImg, registerConfig } from "@/api/login";
|
||||
import Cookies from "js-cookie";
|
||||
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||
|
||||
@ -106,8 +106,17 @@ export default {
|
||||
created() {
|
||||
this.getCode();
|
||||
this.getCookie();
|
||||
this.getRegisterConfig()
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取注册配置信息
|
||||
*/
|
||||
getRegisterConfig(){
|
||||
registerConfig().then(res => {
|
||||
this.register = res.msg == "true" ? true : false
|
||||
})
|
||||
},
|
||||
getCode() {
|
||||
getCodeImg().then(res => {
|
||||
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
||||
|
Loading…
x
Reference in New Issue
Block a user