升级Spring Boot到2.5.x,升级Spring Cloud到2020.x
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
package com.central;
|
||||
|
||||
import com.central.common.ribbon.annotation.EnableFeignInterceptor;
|
||||
import com.central.common.lb.annotation.EnableFeignInterceptor;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
|
||||
|
||||
/**
|
||||
* @author zlt
|
||||
@@ -13,10 +12,12 @@ import org.springframework.session.data.redis.config.annotation.web.http.EnableR
|
||||
@EnableFeignClients
|
||||
@EnableFeignInterceptor
|
||||
@EnableDiscoveryClient
|
||||
@EnableRedisHttpSession
|
||||
//@EnableRedisHttpSession
|
||||
@SpringBootApplication
|
||||
public class UaaServerApp {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(UaaServerApp.class, args);
|
||||
SpringApplication application = new SpringApplication(UaaServerApp.class);
|
||||
application.setEnvironmentPrefix("zlt-uaa");
|
||||
application.run(args);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.central.oauth.service.impl;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.central.common.feign.UserService;
|
||||
import com.central.common.redis.template.RedisRepository;
|
||||
import com.central.common.constant.SecurityConstants;
|
||||
@@ -9,7 +10,6 @@ import com.central.common.model.SysUser;
|
||||
import com.central.oauth.exception.ValidateCodeException;
|
||||
import com.central.oauth.service.IValidateCodeService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -96,11 +96,11 @@ public class ValidateCodeServiceImpl implements IValidateCodeService {
|
||||
*/
|
||||
@Override
|
||||
public void validate(String deviceId, String validCode) {
|
||||
if (StringUtils.isBlank(deviceId)) {
|
||||
if (StrUtil.isBlank(deviceId)) {
|
||||
throw new ValidateCodeException("请在请求参数中携带deviceId参数");
|
||||
}
|
||||
String code = this.getCode(deviceId);
|
||||
if (StringUtils.isBlank(validCode)) {
|
||||
if (StrUtil.isBlank(validCode)) {
|
||||
throw new ValidateCodeException("请填写验证码");
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public class ValidateCodeServiceImpl implements IValidateCodeService {
|
||||
throw new ValidateCodeException("验证码不存在或已过期");
|
||||
}
|
||||
|
||||
if (!StringUtils.equals(code, validCode.toLowerCase())) {
|
||||
if (!StrUtil.equals(code, validCode.toLowerCase())) {
|
||||
throw new ValidateCodeException("验证码不正确");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user