修改环境配置

This commit is contained in:
liujiangtao
2020-07-25 12:39:47 +08:00
parent b5b78b4fff
commit 9e73f6c52b
49 changed files with 2746 additions and 83 deletions

View File

@ -9,7 +9,7 @@ import org.springframework.web.filter.CorsFilter;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import com.muster.common.config.RuoYiConfig;
import com.muster.common.config.MusterConfig;
import com.muster.common.constant.Constants;
import com.muster.framework.interceptor.RepeatSubmitInterceptor;
@ -28,7 +28,7 @@ public class ResourcesConfig implements WebMvcConfigurer
public void addResourceHandlers(ResourceHandlerRegistry registry)
{
/** 本地文件上传路径 */
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + RuoYiConfig.getProfile() + "/");
registry.addResourceHandler(Constants.RESOURCE_PREFIX + "/**").addResourceLocations("file:" + MusterConfig.getProfile() + "/");
/** swagger配置 */
registry.addResourceHandler("swagger-ui.html").addResourceLocations("classpath:/META-INF/resources/");

View File

@ -1,12 +1,5 @@
package com.muster.framework.web.service;
import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import com.muster.common.constant.Constants;
import com.muster.common.core.domain.model.LoginUser;
import com.muster.common.core.redis.RedisCache;
@ -17,6 +10,14 @@ import com.muster.common.exception.user.UserPasswordNotMatchException;
import com.muster.common.utils.MessageUtils;
import com.muster.framework.manager.AsyncManager;
import com.muster.framework.manager.factory.AsyncFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* 登录校验方法
@ -59,13 +60,26 @@ public class SysLoginService
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
return this.login(username, password);
}
/**
* 内部登录验证
*
* @param username 用户名
* @param password 密码
* @return 结果
*/
public String login(String username, String password)
{
// 用户验证
Authentication authentication = null;
try
{
// 该方法会去调用UserDetailsServiceImpl.loadUserByUsername
authentication = authenticationManager
.authenticate(new UsernamePasswordAuthenticationToken(username, password));
.authenticate(new UsernamePasswordAuthenticationToken(username, password));
}
catch (Exception e)
{